File api.php:
$api->version('v1', function ($api) { $api->get('todos', 'App\Http\Controllers\Admin\TodoController@index'); $api->post('todos', 'App\Http\Controllers\Admin\TodoController@store'); //ну и так далее }); How to use middleware to check whether the user is logged in when he tries to enter the admin area via api?