Create model with migration and seeder

Updated at 26-Apr-2021, By samar

Create model with migration and seeder

With this article, we will examine several different instances of how to solve the "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.
  • 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
    

Back to code snippet queries related laravel