Route parameter patterns on routes with similar parameters

前端 未结 1 1103
死守一世寂寞
死守一世寂寞 2021-01-20 06:18

I have a few routes that takes a couple of UUIDs as parameters:

Route::get(\'/foo/{uuid1}/{uuid2}\', \'Controller@action\');

I want to be a

相关标签:
1条回答
  • 2021-01-20 07:15

    There's no built in way to handle this, and I actually think the solution you found is pretty nice. Maybe a bit more elegant would be this:

    Route::patterns(array_fill_keys(['uuid1', 'uuid2'], '/uuid regex/'));
    
    0 讨论(0)
提交回复
热议问题