如何在Laravel中基于迁移文件制作模型 [英] How to make a model based on a Migration file in Laravel

查看:323
本文介绍了如何在Laravel中基于迁移文件制作模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个迁移,并且我想基于迁移文件创建一个模型.

I have already create a migration, and I want to make a model based on the migration file.

这可能吗?如果是这样,该怎么办?

Is this possible? If so, how can this be done?

推荐答案

无法做到这一点.到目前为止,您可以执行的最远的工作是通过运行以下命令同时创建迁移和模型:

It is not possible to do that. The furthest you can go so far is creating a migration and a model at the same time by running:

php artisan make:model ModelName -m

这篇关于如何在Laravel中基于迁移文件制作模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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