enhanced-router icon indicating copy to clipboard operation
enhanced-router copied to clipboard

Filter on Group Domain Route is eating the dyanimc url variable

Open csavory opened this issue 11 years ago • 2 comments

I have a controller route defined no group and it works fine.

Route::controller('users', 'UserController');

Here is the method signature

    public function getShow($id) {

When I add this Route Group with a filter the $id variable does not get passed in anymore.

Route::group(array('domain' => '{domain}'), function()
{
    Route::controller('users', 'UserController');
})->where('domain', '(local.mydomain.com|mydomain.elasticbeanstalk.com)');

The route group with the where is working working fine. It just eats the $id variable and doesn't pass it into the getShow($id) method anymore.

csavory avatar Dec 13 '13 21:12 csavory

I got the same issue when trying to use the group with prefix => "{locale}". Then I have a URL like /messages/1 where 1 is the {id}, but {locale} will be parsed in instead of id, so it is like I would call /messages/en (for instance), which really doesn't make any kind of sense.

marvin-w avatar Feb 07 '14 16:02 marvin-w

I have a doubt. imagine instead of locale, lets consider 'id'. Id is unique identification for users in users table, model. how should i use ->where('id', 'all id in model user');

joicemjoseph avatar Feb 02 '15 11:02 joicemjoseph