Skip to content

Instantly share code, notes, and snippets.

View satheeshdragon's full-sized avatar

satheesh_Dragon satheeshdragon

View GitHub Profile
Example 3-7. Regular expression route constraints
Route::get('users/{id}', function ($id) {
//
})->where('id', '[0-9]+');
Route::get('users/{username}', function ($username) {
//
})->where('username', '[A-Za-z]+');
Route::get('posts/{id}/{slug}', function ($id, $slug) {
//
})->where(['id' => '[0-9]+', 'slug' => '[A-Za-z]+']);
<?php
echo 'Testing web';
?>