PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] How do I instruct artisan to save model to specific directory?

 January 06, 2022     laravel, laravel-5, php     No comments   

Issue

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?


Solution

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


Answered By - Bogdan
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing