Login through API
I have below code in one of controller function which I am trying to access through API.
if (Auth::Check()) {
//more code
} else {
return response()->json([
'message' => 'Please login',
);
}
I used Bearer Token but I can't login.

@afoysal possible just typo? use Auth::check() (lower case for check)
Thanks @silencebringer . I tried your solution Auth::check(). But it is not working. I sent Bearer Token with API request but it is not working.
You can use middleware api group, and you don't need Auth:check() then
Route::group(['middleware' => 'auth:api'], function(){
Route::post('details', 'API\UserController@details');
});
Please or to participate in this conversation.