[英]Laravel 5.5 - No migrations found
I want to use jeremykenedy/laravel-roles .我想使用jeremykenedy/laravel-roles 。 When I type:
当我输入:
$ php artisan migrate:status
There is shows: No migrations found .有显示:未找到迁移。 I have migrations in database/migrations .
我在database/migrations 中有迁移。
How to fix it?如何解决? Thanks in advance!
提前致谢!
Firstly install migration so use this command首先安装迁移所以使用这个命令
php artisan migrate:install
and then use this command然后使用这个命令
php artisan migrate:status
Had this issue recently after adding a config/database.php file.最近在添加 config/database.php 文件后遇到了这个问题。
This file returns an array with database connection settings but also has a key that defines the migrations table.该文件返回一个包含数据库连接设置的数组,但也有一个定义迁移表的键。 If you do not have that definition Laravel will not know where to look for migrations.
如果你没有那个定义,Laravel 将不知道去哪里寻找迁移。
<?php
return [
connections: [
// ...
],
'migrations' => 'migrations' /* <-- make sure you have this line */
];
When you do not have the file it looks in the migrations table by default.当您没有该文件时,默认情况下它会在迁移表中查找。
An example of the config file can be found here https://github.com/laravel/laravel/blob/master/config/database.php可以在此处找到配置文件的示例https://github.com/laravel/laravel/blob/master/config/database.php
您需要首先使用以下命令将资产发布到您的项目:
php artisan vendor:publish --tag=laravelroles
In my case, below steps did the trick.就我而言,以下步骤可以解决问题。
composer install
php artisan migrate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.