How to Create Model in Laravel 6 using Command ?

Laravel 6 , jquery

Nicesnippets

985

25-11-2019


hii guys,

In this tutorial,I will learn you give to create model using command in laravel 6.you can define the make:model command in your terminal. you can simply use command to create model in laravel 6.

Example 1

php artisan make:model Test

->This command is used to create model in laravel project.

->This command is only create to model in project.

->It will create to file in project.

1.Model

->app/Test.php

Example 2

php artisan make:model Test --migration

or

php artisan make:model Test -m

->This command is use to create model with migration in laravel project.

->It will create to files in project.

1.Model

->app/Test.php

2.Migration

->migrations/2019_11_25_120339_create_tests_table.php

Example 3

php artisan make:model Test --controller

or

php artisan make:model Test -c

->This command is used to create model with controller in your laravel project.

->It will create to files in project.

1.Model

->app/Test.php

2.Controller

->app/Http/Controllers/TestController.php

Example 4

php artisan make:model Test --resource

or

php artisan make:model Test -r

->This command is used to create model,controller or crud method in your laravel project.

->It will create to files in project.

1.Model

->app/Test.php

2.Controller

->app/Http/Controllers/TestController.php

3.crud Method

->index(),create(),store(),show(),update()

Example 5

php artisan make:model Project --migration --controller --resource

or

php artisan make:model Project --all

or

php artisan make:model Project -a

->This command is used to create model,migration or controller with crud method in laravel project.

->It will create to files in project.

1.Model

->app/Test.php

2.Migration

->migrations/2019_11_25_120339_create_tests_table.php

3.Controller

->app/Http/Controllers/TestController.php

4.crud Method

->index(),create(),store(),show(),update()

It will help you....


Recommended Posts