douou1872 2016-04-14 12:10
浏览 79
已采纳

如何从已编辑的模型生成laravel-migrations?

I've been looking into PHP-frameworks lately to find out which suits me best. I've had some experience with the java Play! framework which did some very nice things. One very nice feature that I haven't found in Laravel yet, is that when you edit your model, it can generate migrations for you. Is there a way in Laravel to generate migrations automatically from edits on your model? This would seem like a huge improvement to me, since migrations seem like a bit of a hassle to me right now.

I'm looking forward to your opinions and help!

  • 写回答

1条回答 默认 最新

  • doujichan1399 2016-04-14 12:22
    关注

    You only specify the columns in the migration and not on the model, so you don't have to edit anything on the model.

    You first specify the columns (properties) for a table in the migrations. Then you use those properties in your Eloquent Models.

    You don't have to put all properties in the model, when you create a column with a migration it is accessable via a model, without also specifying it in the model.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab有关常微分方程的问题求解决
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable