Skip to content

Instantly share code, notes, and snippets.

@imliam
Created March 20, 2017 13:17
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 imliam/5a0335b5d227db6f8fb9e2da2e2d8594 to your computer and use it in GitHub Desktop.
Save imliam/5a0335b5d227db6f8fb9e2da2e2d8594 to your computer and use it in GitHub Desktop.
Laravel 5 - Route must start with @
<?php
/*
|--------------------------------------------------------------------------
| Laravel 5 - Route must start with @
|--------------------------------------------------------------------------
|
| A quick snippet showing use of the Route::where(); method that lets you
| define a regex pattern for the route to match, such as the "@" symbol
| at the beginning to denote a user.
|
*/
Route::get('/users/{user}', 'UserController@index')->where('user', '^@.*');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment