I'm working on a REST API using JWT.
The login route is good, but the router in group middleware jwt.auth
doesn't work.
Error:
Symfony\Component\Debug\Exception\FatalThrowableError: Call to undefined method Illuminate\Events\Dispatcher::fire()
My code:
Route::group(['namespace' => 'Api'], function(){
Route::get('user/login', 'AuthController@login');
Route::group(['middleware' => ['jwt.auth']], function() {
Route::get('auth/me', 'AuthController@me');
});
});
fire
was changed to dispatch
in laravel 5.8 here https://github.com/laravel/framework/pull/26392
If you use tymondesigns/jwt-auth
package, this issue help you : https://github.com/tymondesigns/jwt-auth/issues/1787
This version fix this problem : https://github.com/tymondesigns/jwt-auth/releases/tag/1.0.0-rc.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With