I'm trying to make an api route that's only accessible if the user making the request is logged in. This is what I have in my routes/api.php
but it returns
{"error":"Unauthenticated."}
Route::group(['middleware' => ['auth:api'], function () {
Route::post('schedules', ['uses' => 'Api\ScheduleController@store']);
});
Can this be done without laravel passport and how? I only need the route for in-app use for logged in users.