route in laravel 5.8 code example
Example 1: group routes in laravel
Route::middleware(['first', 'second'])->group(function () {
Route::get('/', function () {
});
Route::get('/user/profile', function () {
});
});
Example 2: route() and with() in laravel
Route::get('user/{id}/profile', function ($id) {
})->name('profile');
$url = route('profile', ['id' => 1, 'photos' => 'yes']);
Example 3: laravel route
Route::get('user/{id}', function ($id) {
return 'User '.$id;
});
Example 4: laraval routing
Route::redirect('/here', '/there', 301);