laravel route with id code example

Example 1: add id to route name in laravel blade

route('something.edit', ['id' => $event->data->id])

Example 2: laravel routes return view in web.php

Route::get("/page", function(){
   return View::make("dir.page");
});

Example 3: laravel route

Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});

Example 4: laravel route

Route::view('/welcome', 'welcome');

Route::view('/welcome', 'welcome', ['name' => 'Taylor']);

Example 5: laravel route

Route::get('posts/{post}/comments/{comment}', function ($postId, $commentId) {
    //
});