PHP artisan package:discover --ansi 报错 不知道怎么回事。。。

使用php artisan package:discover --ansi 突然报错了,不知道什么情况。
然后把vendor文件删除之后重新
composer update
还是出错
请问怎么解决?

G:\WWW\renwubao>php artisan package:discover --ansi
PHP Fatal error:  Uncaught Error: Call to a member function connection() on null in G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php:1249
Stack trace:
#0 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1215): Illuminate\Database\Eloquent\Model::resolveConnection('mysql')
#1 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1047): Illuminate\Database\Eloquent\Model->getConnection()
#2 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(964): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#3 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(642): Illuminate\Database\Eloquent\Model->newModelQuery()
#4 G:\WWW\renwubao\vendor\laravel-admin-ext\reporter\src\Reporter.php(117): Illuminate\Database\Eloquent\Model->save()
#5 G:\WWW\renwubao\vendor\laravel-admin-ext\reporter\src\Reporter.php(69): Encore\Admin\Reporter\Reporter->store(Array)
#6 G:\WWW\renwubao in G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 1249
PHP Fatal error:  Uncaught Error: Call to a member function connection() on null in G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php:1249
Stack trace:
#0 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1215): Illuminate\Database\Eloquent\Model::resolveConnection('mysql')
#1 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(1047): Illuminate\Database\Eloquent\Model->getConnection()
#2 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(964): Illuminate\Database\Eloquent\Model->newBaseQueryBuilder()
#3 G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php(642): Illuminate\Database\Eloquent\Model->newModelQuery()
#4 G:\WWW\renwubao\vendor\laravel-admin-ext\reporter\src\Reporter.php(117): Illuminate\Database\Eloquent\Model->save()
#5 G:\WWW\renwubao\vendor\laravel-admin-ext\reporter\src\Reporter.php(69): Encore\Admin\Reporter\Reporter->store(Array)
#6 G:\WWW\renwubao in G:\WWW\renwubao\vendor\laravel\framework\src\Illuminate\Database\Eloquent\Model.php on line 1249
《L02 从零构建论坛系统》
以构建论坛项目 LaraBBS 为线索,展开对 Laravel 框架的全面学习。应用程序架构思路贴近 Laravel 框架的设计哲学。
《L03 构架 API 服务器》
你将学到如 RESTFul 设计风格、PostMan 的使用、OAuth 流程,JWT 概念及使用 和 API 开发相关的进阶知识。
最佳答案

是config/app.php里providers 里加载的类名有个是空的

3个月前 评论
讨论数量: 3
Epona

数据库没有配置好?

3个月前 评论
asdasdcn (楼主) 3个月前

已经解决了。

3个月前 评论

是config/app.php里providers 里加载的类名有个是空的

3个月前 评论

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!