【问题标题】:Laravel composer and package discoverLaravel 作曲家和包发现
【发布时间】:2018-05-01 16:49:20
【问题描述】:

在克隆后的新项目中运行 composer install 我有:

Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover


[Illuminate\Database\QueryException]                                         
SQLSTATE[42S02]: Base table or view not found: 1146 Table 
'cryptoreview.out  
going_links' doesn't exist (SQL: select * from `outgoing_links`)             



[Doctrine\DBAL\Driver\PDOException]                                          
SQLSTATE[42S02]: Base table or view not found: 1146 Table 
'cryptoreview.out  
going_links' doesn't exist                                                   



[PDOException]                                                               
SQLSTATE[42S02]: Base table or view not found: 1146 Table 
'cryptoreview.out  
going_links' doesn't exist  

package:discover 到底想做什么?

我试图修复正在运行的 php artisan migrate 但是:

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'cryptoreview.outgoing_links' doesn't exist (SQL: select * from `outgoing_links`)  

这是一个完全阻塞的情况。没有办法继续下去了

【问题讨论】:

  • Laravel 5.5 引入了包发现来自动注册包服务提供者。不知道为什么它试图访问数据库,但它看起来可能是您的迁移问题?如果您尝试运行php artisan migrate:fresh 会发生什么? (注意:fresh
  • 运行migrate:fresh 将删除数据库中的所有数据。

标签: php laravel composer-php laravel-artisan


【解决方案1】:

尝试在终端中运行 composer global update 以更新您的作曲家。对于未找到的基表,请确保您的表迁移是 Schema::create 而不是 Schema::table。不要忘记同名表的上下函数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-05-31
    • 2016-11-23
    • 2018-07-19
    • 2014-02-25
    • 2013-02-02
    • 2018-10-03
    • 2015-05-29
    • 1970-01-01
    相关资源
    最近更新 更多