route match in laravel code example
Example 1: laravel group routes
Route::group(['prefix' => 'admin'], function () {
Route::get('users', function () {
// Matches The "/admin/users" URL
});
});
Example 2: laravel route pattern
Route::pattern('id', '[0-9]+');
Route::get('user/{id}', function ($id) {
// Only executed if {id} is numeric...
});
Example 3: laravel route match
Route::match(['get', 'post'], '/', function () {
//
});
Route::any('/', function () {
//
});