Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

heavycode's avatar

Issue with localization and authorization

Hi to everyone. Hi have an issue with localization and authorization. I followed

https://laracasts.com/discuss/channels/tips/example-on-how-to-use-multiple-locales-in-your-laravel-5-website/

but i have some issues when going on auth and password controller becouse the middleware tries to prefix my route to something like domain/locale/login...but i throws a NotFoundHttpException in RouteCollection.php

Any Ideas?

this is my routes.php

/* HOME */
Route::get('/home', ['uses' => 'FrontendHomeController@index', 'as' => 'frontend.home.index']);
Route::get('/chi-siamo', ['uses' => 'FrontendHomeController@chiSiamo', 'as' => 'frontend.home.chi-siamo']);
Route::get('/dove-siamo', ['uses' => 'FrontendHomeController@doveSiamo', 'as' => 'frontend.home.dove-siamo']);
Route::get('/contatti', ['uses' => 'FrontendHomeController@contatti', 'as' => 'frontend.home.contatti']);
Route::get('/campagne', ['uses' => 'FrontendHomeController@campagne', 'as' => 'frontend.home.campagne']);
Route::get('/', ['uses' => 'FrontendHomeController@index', 'as' => 'frontend.home.index']);

/* VALIGIA */
Route::get('/valigia-gluten-free', ['uses' => 'FrontendValigiaController@index', 'as' => 'frontend.valigia.index']);
Route::get('/valigia-gluten-free/acquisto', ['uses' => 'FrontendValigiaController@acquisto', 'as' => 'frontend.valigia.acquisto', 'middleware' => 'auth']);
Route::post('/valigia-gluten-free/pagameto', ['uses' => 'FrontendValigiaController@pagamento', 'as' => 'frontend.valigia.pagamento']);
Route::get('/valigia-gluten-free/successo', ['uses' => 'FrontendValigiaController@successo', 'as' => 'frontend.valigia.successo-pagamento']);
Route::get('/valigia-gluten-free/errore-pagamento', ['uses' => 'FrontendValigiaController@errorePagamento', 'as' => 'frontend.valigia.errore-pagamento']);
Route::get('/valigia-gluten-free/ordini', ['uses' => 'FrontendValigiaController@ordini', 'as' => 'frontend.valigia.ordini', 'middleware' => 'auth']);

/* PRODOTTI */
Route::get('/prodotti', ['uses' => 'FrontendProdottoController@index', 'as' => 'frontend.prodotti.index']);
Route::get('/prodotti/{categoria}', ['uses' => 'FrontendProdottoController@categoria', 'as' => 'frontend.prodotti.categoria']);
Route::get('/prodotti/{categoria}/{prodotto}', ['uses' => 'FrontendProdottoController@prodotto', 'as' => 'frontend.prodotti.dettaglio']);

/* PAGAMENTI */
Route::post('pay_via_paypal', 'PaymentController@postPayment');
Route::get('payment_success', 'PaymentController@getSuccessPayment');

Route::controllers([ 'auth' => 'Auth\AuthController', 'password' => 'Auth\PasswordController' ]);

0 likes
3 replies
heavycode's avatar

i had a little mistake: it doesn't prefix with auth: in place of domain/locale/auth/login it outputs domain/locale/login

buro-buro's avatar

bumping.. id like to know how to combine prefixes with my current route groups as well

jacquelinepeh's avatar

Hihi, i'm having the same auth issue too. Is there any fix for it?

My current issue is "domain.com/ph/auth/login", after i tried to login, it directs me to "domain.com/ph/login"

This is in my routes.php: Route::get('auth/login', 'Auth\AuthController@getLogin'); Route::post('auth/login', 'Auth\AuthController@postLogin'); Route::get('auth/logout', 'Auth\AuthController@getLogout');

Please or to participate in this conversation.