Create model with migration and seeder

You can create a model with migration and seeder file using a single command. php artisan make:model ModelName -ms. This command will create a model with a migration and seeder file. You can also specify the path with the model to create a folder inside the Models directory as per laravel version 8 like php artisan make:model DirInsideModels\ModelName -ms.

Answers 1
  • Create model with migration and seeder in laravel

    //Artisan command - create a model with migration and seeder 
    php artisan make:model ProductCategory -ms
    
    //Artisan command - create model with migration and seeder with specific path 
    php artisan make:model InsideModels\ProductCategory -ms
    
    0
  • Back to code snippet queries related laravel