Madthumb's avatar

Lumen 5.4 get routes data

I defined a custom route and assign few variables, but I am not sure how can I use them, for example auth, from middleware?

// routes.php

$app->post('stylist/auth', [ 'as' => 'api.stylist', 'auth'=>'bearer', 'uses' => 'User@auth_account' ]);

0 likes
1 reply
Robert-Jan's avatar

In this case auth is a middleware so you have to register the middleware and its parameter like this:

$app->post('stylist/auth', [ 'as' => 'api.stylist', 'middleware' => 'auth:bearer', 'uses' => 'User@auth_account']);

Please or to participate in this conversation.