Last active
May 28, 2023 06:35
-
-
Save antimech/8c69f4c0ecb0f6d9fceaa102cc3ce814 to your computer and use it in GitHub Desktop.
Laravel Route Regular Expression Constraints example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::get('/welcome', function () { | |
return view('welcome'); | |
}); | |
Route::get('/{link}', 'LinkController@show') | |
->where(['link' => '[a-zA-Z0-9_]+']) | |
->name('link.show'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment