【问题标题】:Laravel 5.5 - No migrations foundLaravel 5.5 - 未找到迁移
【发布时间】:2019-02-07 22:09:53
【问题描述】:

我想使用 jeremykenedy/laravel-roles。当我输入时:

$ php artisan migrate:status

有显示:未找到迁移。 我在数据库/迁移中有迁移。

如何解决? 提前致谢!

【问题讨论】:

  • 也许你要php artisan vendor:publish
  • 我在数据库/迁移中有迁移
  • php artisan vendor:publish --tag=laravelroles

标签: php mysql laravel database-migration


【解决方案1】:

首先安装迁移所以使用这个命令

php artisan migrate:install

然后使用这个命令

php artisan migrate:status

【讨论】:

    【解决方案2】:

    最近在添加 config/database.php 文件后遇到了这个问题。

    此文件返回一个包含数据库连接设置的数组,但也有一个定义迁移表的键。如果你没有这个定义,Laravel 将不知道去哪里寻找迁移。

    <?php
    
    return [
      connections: [
        // ...
      ],
      'migrations' => 'migrations' /* <-- make sure you have this line */
    ];
    

    当您没有文件时,它会默认在迁移表中查找。

    可以在此处找到配置文件的示例 https://github.com/laravel/laravel/blob/master/config/database.php

    【讨论】:

      【解决方案3】:

      您需要先将资产发布到您的项目中:

      php artisan vendor:publish --tag=laravelroles
      

      【讨论】:

        【解决方案4】:

        在我的情况下,以下步骤可以解决问题。

        composer install
        
        php artisan migrate
        

        【讨论】:

          猜你喜欢
          • 2021-11-07
          • 2014-02-28
          • 2015-08-29
          • 1970-01-01
          • 2019-02-05
          • 1970-01-01
          • 2018-10-18
          • 2013-10-16
          • 2018-04-26
          相关资源
          最近更新 更多