James Jeffery James Jeffery - 24 days ago 9
PHP Question

How do I instruct artisan to save model to specific directory?

I'm using Laravel 5. I have created a

/Models
directory under the
/App
directory, but when generating the models using Artisan it's storing them under the
App
directory.

I have searched the documentation to try and find how to specify a different path name, but to no avail:

php artisan make:model TestModel


How do I instruct
artisan
to save the model to specific directory?

Answer

If you want to specify the path when generating a model, you can use the Laravel Generators Package. You can then specify the location using the --path option like so:

php artisan generate:model TestModel --path=my/custom/location
Comments