named route with parameter laravel
snippet in php

delete route method in laravel

user1950

<form method="POST" action="{{ route('route.name', [ 'id'=> $item->id ]) }}">
              @csrf
              <input type="hidden" name="_method" value="DELETE">
              <button type="submit" class="btn btn-danger btn-icon">
                <i data-feather="delete"></i>
              </button>
            </form>

laravel route

user384

# Using Request
Route::get('user/{name}', function (Request $request) {
    return $request->route('name');
});

laravel route

user5942

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

named route with parameter laravel

user3259

Route::get('/menu/{category}/{product}/{item}', ['as' => 'named.route' , 'uses' => 'MenuController@listItem']);

// to get the actual linke
route('named.route', ['category' => $category->id, 'product' => $product->id, 'item' => $item->id]);

laravel route

user7575

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

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

laravel route

user225

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