在laravel中的自定义路径中创建模型 [英] Create model in a custom path in laravel

查看:224
本文介绍了在laravel中的自定义路径中创建模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在自定义路径中创建模型.如果我像下面这样编写php artisan命令,它将在应用程序内部创建模型.

I want to create a model in a custom path. If i write the php artisan command like the following it will create model inside app.

php artisan make:model core

但是我想在定制的Models文件夹内创建模型文件.我该怎么办?

But i want to create the model file inside the custom made Models folder. How can i do it ?

推荐答案

只需定义要在其中创建模型的路径.

Just define the path where you want to create model.

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

例如

php artisan make:model Models/core

这篇关于在laravel中的自定义路径中创建模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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