lundi 24 octobre 2016

Passport authentication is not working in laravel 5.3

I have set-up Laravel using passport as per the documentation here: http://ift.tt/2f8AbO7.

I have written one route in API route and send request http://localhost/laravel_project/public/api/user using postman but its showing me below error:

NotFoundHttpException in RouteCollection.php line 161:

I have the following route (in routes/api.php):

Route::get('/user', function (Request $request) {
    return array(
      1 => "John",
      2 => "Mary",
      3 => "Steven"
    );
})->middleware('auth:api');

but when I removed ->middleware('auth:api') line in the route its work fine for me.

How can I fix this?

Also please tell me if I don't want to add passport authentication in my some routes how I can do this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire