Skip to content

Instantly share code, notes, and snippets.

@tpavlek
Created October 27, 2015 16:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tpavlek/3708a8ff1d908bd511af to your computer and use it in GitHub Desktop.
Save tpavlek/3708a8ff1d908bd511af to your computer and use it in GitHub Desktop.
Multiple laravel routes with same signature, different constraints
get('persons/{id}', function ($id) {
dd("string name");
})->name('test1');
get('persons/{id}', function ($id) {
dd("matching numeric ID");
})->name('test2')->where('id', '^[0-9,]+\d$');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment