I\'m using VueJS in my front-end, so I have this API call somewhere in the front-end code:
let products = axios.get(\'api/products\');
You can check user Auth of API calls by this:
At first add this use code in your Class:
use Auth;
Then add this code in your function:
if (Auth::guard('api')->check()) { logger(Auth::guard('api')->user()); // to get user }else{ logger("User not authorized"); }