• <i id='fyp9l'><tr id='fyp9l'><dt id='fyp9l'><q id='fyp9l'><span id='fyp9l'><b id='fyp9l'><form id='fyp9l'><ins id='fyp9l'></ins><ul id='fyp9l'></ul><sub id='fyp9l'></sub></form><legend id='fyp9l'></legend><bdo id='fyp9l'><pre id='fyp9l'><center id='fyp9l'></center></pre></bdo></b><th id='fyp9l'></th></span></q></dt></tr></i><div id='fyp9l'><tfoot id='fyp9l'></tfoot><dl id='fyp9l'><fieldset id='fyp9l'></fieldset></dl></div>
    1. <small id='fyp9l'></small><noframes id='fyp9l'>

      1. <legend id='fyp9l'><style id='fyp9l'><dir id='fyp9l'><q id='fyp9l'></q></dir></style></legend><tfoot id='fyp9l'></tfoot>

          <bdo id='fyp9l'></bdo><ul id='fyp9l'></ul>

        可以修改由 artisan migrate 命令创建的模板吗?

        Can one modify the templates created by artisan migrate command?(可以修改由 artisan migrate 命令创建的模板吗?)
          <tbody id='QGKd2'></tbody>
      2. <legend id='QGKd2'><style id='QGKd2'><dir id='QGKd2'><q id='QGKd2'></q></dir></style></legend>

        <tfoot id='QGKd2'></tfoot>
          • <i id='QGKd2'><tr id='QGKd2'><dt id='QGKd2'><q id='QGKd2'><span id='QGKd2'><b id='QGKd2'><form id='QGKd2'><ins id='QGKd2'></ins><ul id='QGKd2'></ul><sub id='QGKd2'></sub></form><legend id='QGKd2'></legend><bdo id='QGKd2'><pre id='QGKd2'><center id='QGKd2'></center></pre></bdo></b><th id='QGKd2'></th></span></q></dt></tr></i><div id='QGKd2'><tfoot id='QGKd2'></tfoot><dl id='QGKd2'><fieldset id='QGKd2'></fieldset></dl></div>
              <bdo id='QGKd2'></bdo><ul id='QGKd2'></ul>

              <small id='QGKd2'></small><noframes id='QGKd2'>

                  本文介绍了可以修改由 artisan migrate 命令创建的模板吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我为我的迁移创建了一个基类.目前我运行 artisan migrate 命令,它创建了一个扩展 Migrations 文件的新迁移,但是我想包含我的 BaseMigration 并从那里扩展它.我一直在手动进行此更改,但我觉得我在不必要地重复自己.

                  I've created a base class for my migrations. At the moment I run the artisan migrate command and it creates a new migration that extends the Migrations file, however I want to include my BaseMigration and extend it from there. I've been making this changes manualy but I feel like I'm repeating myself unnecessarily.

                  关于如何让新迁移自动扩展和加载我的基础迁移有什么建议吗?

                  Any advice on how to have new migrations automatically extend and load my base migration?

                  推荐答案

                  我不认为你可以,因为 Laravel 从 vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs 文件夹,你不能改变它,但你有一些选择:

                  I don't think you can, because Laravel takes migrations from the vendor/laravel/framework/src/Illuminate/Database/Migrations/stubs folder and you cannot change that, but you have some options:

                  1) 创建您自己的工匠命令migrate:makemyown.

                  1) Create your own artisan command migrate:makemyown.

                  2) 使用 Jeffrey Way 的 Laravel 生成器.他们让您通过以下方式创建迁移:

                  2) Use Jeffrey Way's Laravel Generators. They let you create your migrations by doing:

                  php artisan generate:migration create_posts_table --fields="title:string, description:text"
                  

                  如果您只有一些需要开始的字段,而不是更具体的字段,那么它真的很好.

                  If you just have some fields you need to start with and not something more specific than that, it works really fine.

                  3) 编辑 Laravel 存根,但问题是一旦你 composer update 它们可能会被 Composer 覆盖.

                  3) Edit Laravel stubs, but the problem is that as soon as you composer update they might get overwritten by Composer.

                  这篇关于可以修改由 artisan migrate 命令创建的模板吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Laravel 4 - Connect to other database(Laravel 4 - 连接到其他数据库)
                  Call external API function from controller, LARAVEL 4(从控制器调用外部 API 函数,LARAVEL 4)
                  Empty string instead of null values Eloquent(空字符串而不是空值 Eloquent)
                  quot;laravel.logquot; could not be opened: failed to open stream(“laravel.log无法打开:无法打开流)
                  Displaying the Error Messages in Laravel after being Redirected from controller(从控制器重定向后在 Laravel 中显示错误消息)
                  Laravel Creating Dynamic Routes to controllers from Mysql database(Laravel 从 Mysql 数据库创建到控制器的动态路由)

                    <bdo id='yNAbI'></bdo><ul id='yNAbI'></ul>
                  • <tfoot id='yNAbI'></tfoot>
                      <legend id='yNAbI'><style id='yNAbI'><dir id='yNAbI'><q id='yNAbI'></q></dir></style></legend>

                      1. <i id='yNAbI'><tr id='yNAbI'><dt id='yNAbI'><q id='yNAbI'><span id='yNAbI'><b id='yNAbI'><form id='yNAbI'><ins id='yNAbI'></ins><ul id='yNAbI'></ul><sub id='yNAbI'></sub></form><legend id='yNAbI'></legend><bdo id='yNAbI'><pre id='yNAbI'><center id='yNAbI'></center></pre></bdo></b><th id='yNAbI'></th></span></q></dt></tr></i><div id='yNAbI'><tfoot id='yNAbI'></tfoot><dl id='yNAbI'><fieldset id='yNAbI'></fieldset></dl></div>
                            <tbody id='yNAbI'></tbody>

                          <small id='yNAbI'></small><noframes id='yNAbI'>