Support the ongoing development of Laravel.io →
Configuration Authentication Requests

So here's a problem I've encountered now. I have some page to view stats for different kinds of content, and I created some ajax routes to select specific content for the stats. The problem is, Laravel logs user out on a route (and this is not intended). I don't have any logout functionality except /auth/logout route.

Here are my routes for stats:

Route::get('stats',                                 ['as' => 'stats',                   'uses' => 'MoneySharesController@index']);
Route::get('stats/media/{id?}',                     ['as' => 'stats.media',             'uses' => 'MoneySharesController@media']);
Route::get('stats/pictures/{id?}',                  ['as' => 'stats.pictures',          'uses' => 'MoneySharesController@pictures']);
Route::get('stats/products/{id?}',                  ['as' => 'stats.products',          'uses' => 'MoneySharesController@products']);

Route::get('stats/content/media',                   ['as' => 'stats.content.media',     'uses' => 'MoneySharesController@mediaContent']);

The last route is the broken one. If I access /stats/content/media - it logs me out! If I access /stats/media/content (if i put this route after the first one), it works fine. What's the problem here ?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

WrongWay wrongway Joined 2 May 2016

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.