如何指示技工将模型保存到特定目录? [英] How do I instruct artisan to save model to specific directory?

查看:63
本文介绍了如何指示技工将模型保存到特定目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel5.我已经在/App目录下创建了/Models目录,但是当使用Artisan生成模型时,会将它们存储在App目录下.

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

如何指示artisan将模型保存到特定目录?

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

推荐答案

如果要在生成模型时指定路径,则可以使用

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

这篇关于如何指示技工将模型保存到特定目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆