Search code examples
phplaravellaravel-artisan

Make Model, Migration and Controller with one artisan command, but Controller needs to be in different directory


Is there a way to make Model, Migration and Controller with one Artisan command. But the controller I would like to be in placed in different sub-directory, not in Artisan's default directory. Thank you for help/suggestions.


Solution

  • In two lines you could do:

    //create model and migration
    php artisan make:model ModelName -m
    
    //create controller in subfolder
    php artisan make:controller  subfolder/Controller