Q: Laravel advanced routing with regex I am trying to make conditional routes such that:
api/users/1-3
api/users/1+3
api/users/1,2,3
all route separately.
I have:
Route::get('users/{ids}', function($ids)
{
    echo 'Commas';
})->where('ids', '[\d,]+');

Route::get('users/{ids}', function($ids)
{
    echo 'Ranges';        
})->where('ids', '[\d-]+');

Route::get('users/{ids}', function($ids)
{
    echo 'Id plus n';
})->where('ids', '[\d+]+');  

Each of these works correctly separately, but when I try to use them together, only the last one (they can be rearranged to the same affect) works and the other 2 throw "NotFoundHttpException" errors.
Appreciate the help

A: You can't use the same name for the parameters, becuase now, you override all previous regex rules with the last one registered. This happens because they all refer to the same route:
Route::get('users/{csids}', function($csids)
{
    echo 'Commas';
})->where('csids', '[\d,]+');

Route::get('users/{rangeids}', function($rangeids)
{
    echo 'Ranges';        
})->where('rangeids', '[\d-]+');

Route::get('users/{plusids}', function($plusids)
{
    echo 'Id plus n';
})->where('plusids', '[\d+]+');  

