I have followed following guide to make an Authentication Api, and an api which uses the authentication from the first one. I have done everything exactly the same, but i still get this error:
InvalidArgumentException: Auth guard [jwt] is not defined. in file folder/to/project/vendor/laravel/framework/src/Illuminate/Auth/AuthManager.php on line 84
The guide i have followed is: https://medium.com/swlh/build-jwt-authentication-between-multiple-api-with-laravel-fbd03352aaa3
My config/auth
looks like this:
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'jwt',
'provider' => 'users',
// 'hash' => false,
],
],
Then my app/guard/JWTGuard.php
looks exactly like in the guide.
My routes/api.php
look the following:
Route::middleware('auth:jwt')->resource('projects', ProjectController::class);
Does anybody has this issue before and know how to solve it?