Creating a model in a user path in laravel

I want to create a model in a custom way. If I write the php artisan command as follows, it will create a model inside the application.

php artisan make:model core

But I want to create a model file inside the model folder you created. How can i do this?

+4
source share
2 answers

Just specify the path in which you want to create the model.

php artisan make:model <directory_name>/<model_name>

eg.

php artisan make:model Models/core
+9
source

You can easily do this using the custom directory of your model folder (I assume the model folder is a subfolder of the application). Just use this command php artisan make:model Models/core, after which you will get the result of your desire.
Thank.

+1

All Articles