I created api route:

File `routes/api.php:`

```
Route::middleware('auth:api')->get('/user', 
function (Request $request) {
    return $request->user();
});

Route::middleware('auth:api')->group(function() 
{
    Route::get('/tasks','TaskController@index');
});

```

After that I go to `/api/tasks`, middleware redirects to /home, what i should to do to use /api/tasks without redirecting to /home(i am logged), and also i could to use this middleware?

Laravel 5.5