Support the ongoing development of Laravel.io →
posted 6 years ago
Laravel

I have a Laravel 5.5 application I am able to login with API but unable to access routes with "auth:api" middleware.

Sending headers like

1 . Accept = application/json

2 . Authorization = Bearer eyJ0eXAi.....xxxxxxxx

In api.php

Route::group(['middleware' => ['auth:api'], 'prefix' => 'v1',], function(){
	Route::get('me', 'Api\UserController@me');
}

This working on local but not on server.

Checked error_log file and laravel.log file. But no luck.

Last updated 3 years ago.
0

I am having the exact same error. Is there any resolution yet?

0

In terminal: run php artisan route:list, if you see the 'web' middleware being applied to routes twice, remove the middleware from your group.

also You can see this in the ``` RouteServiceProvider

0

Sign in to participate in this thread!

PHPverse

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.