Question : Laravel Passport Route [login] not defined
Answered by : abdul-rahman-c2uz91hcmt47
// add an extra middleware with below handler
public function handle($request, Closure $next)
{ if(!in_array($request->headers->get('accept'), ['application/json', 'Application/Json'])) return response()->json(['message' => 'Unauthenticated.'], 401); return $next($request);
}
//set priority in app/Http/Kernel.php
Source : | Last Update : Wed, 13 Jul 22
Question : Route [login] not defined.Route [login] not defined.
Answered by : lokesh-ramchandani
You're trying to redirect to a named route whose name is login, but you have
no routes with that name:
Route::post('login', [ 'as' => 'login', 'uses' => 'LoginController@do']);
The 'as' portion of the second parameter defines the name of the route. The
first string parameter defines its route.
Source : | Last Update : Fri, 28 Aug 20