I have just install laravel 5.4 & using xampp server
facing issue in spatie. after installing by 'composer require spatie/laravel-permission'
adding Spatie\Permission\PermissionServiceProvider::class, to service providers, in config/app.php
next when i use this command
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider" --tag="m
igrations&#34 ;, 我收到如下错误
PHP Fatal error: Call to a member function connection() on null in C:\xampp\htdocs\project\laravel\vendor\laravel\frame
第1041行work \ src \ Illuminate \ Database \ Eloquent \ Model.php
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to a member function connection() on null
答案 0 :(得分:0)
安装软件包后,确保已在config / app.php providers数组中包含服务提供程序,然后运行以下命令
php artisan vendor:publish
答案 1 :(得分:0)
我通过将Spatie的服务提供商放在数据库服务提供商之后修复了它。
在config / apps.php中,在providers数组中,放置
Spatie\Permission\PermissionServiceProvider::class,
之后 >>
Illuminate\Database\DatabaseServiceProvider::class,
再次重新运行publish命令。我不确定为什么。