yasin10's avatar

Dynamic prefix value appearing in function parameter

I've added a prefix group locale in route. Now locale value is appearing in function parameters instead of desired value.

Route::group(["prefix" => "{locale?}", "middleware" => 'locale'], function() {
	Route::post('accept/{request}', 'RequestController@accept');
});

In RequestController:

function accept($request) {
	dd($request); // en
}

It prints en instead of request id (r1ad) Also, i don't want to modify my named routes parameters since whole project is in live mode and i don't want to make changes in each files

currently the route list is appearing as:

{locale?}/accept/{request}

Due to which it is taking first locale value as a param

0 likes
4 replies
yasin10's avatar

Also, I've to manage language wise cookies like if url is of example.com/en than cookie value like uid should not merge with uid of example.com/ro. So can i manage these type of thing in above package? @michaloravec

MichalOravec's avatar

Create service provider or middleware with custom logic for that.

yasin10's avatar

Project is in live mode and i don't want to make changes in each file for named routes and etc. Since it'll be cumbersome to do that. I need minimal configurations for that.

Please or to participate in this conversation.