我在作曲家更新后收到此错误.... 我正在使用laravel版本5.4。*
调用未定义的方法Illuminate \ Foundation \ Application :: share()
我的供应商数组
`'providers' => [App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
'Tymon\JWTAuth\Providers\JWTAuthServiceProvider'
],`
我的别名数组
'aliases' => ['View' => Illuminate\Support\Facades\View::class,
'JWTAuth' => 'Tymon\JWTAuth\Facades\JWTAuth',
'JWTFactory' => 'Tymon\JWTAuth\Facades\JWTFactory'
],
我的composer.json ,
"tymon/jwt-auth": "0.5.*"
错误是
C:\wamp\www\myproject\app>php artisan vendor:publish --provider="Tymon\JW
TAuth\Providers\JWTAuthServiceProvider"
PHP Fatal error: Call to undefined method Illuminate\Foundation\Application::sh
are() in C:\wamp\www\myproject\app\vendor\tymon\jwt-auth\src\Providers\JW
TAuthServiceProvider.php on line 122
答案 0 :(得分:1)
使用dev-master分支。编辑yout composer json文件。
data_files
和作曲家更新
答案 1 :(得分:0)
如果要在app.php中添加提供程序,代码如下:
ProviderPath/ProviderName::class,
更改此行:
'providers' => [App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
'Tymon\JWTAuth\Providers\JWTAuthServiceProvider'//this one
],
到
'providers' => [App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class //this one
],