Friday, May 21, 2021

how to create model with the migration , seeder, factory , controller at same time ?

 Syntax : php artisan make:model ModelNmae .

This command will create a model with ModelName. During the model creation, we can create a seeder, factory, controller, migration for the model .

Syntax: PHP artisan make: model Profile --all 

for creating Migration only 

PHP artisan make: model Profile -m 

or 

PHP artisan make: model --migration 

similar way you can generate Factory 

PHP artisan make: model Profile -f

or 

PHP artisan make: model --factory

similar way you can generate Controller

PHP artisan make: model Profile -c

or 

PHP artisan make: model --controller

similar way you can generate ControllerSeeder

PHP artisan make model Profile -s

or 

PHP artisan make: model --seeder



No comments:

Post a Comment

Call Factory and make multiple record entry Using tinker

  $d = Factory(App\Department::class,3)->create(); > $d = Factory(App\Department::class, 10)->create(); = Illuminate\Database\Eloqu...