Send id with route Laravel

How to Pass $id in Laravel Route Parameter. I have following code.

  route('user.show') 
Answers 1
  • //resources\views\welcome.blade.php
    <a href="{{ route('user.show', ['id'=>$id]) }}"> show user details </a>
    
    //routes\web.php
    Route::get('user/{id}', [HomeController::class, 'getUserDetail'])->name('user.show');
    
    0
  • Back to code snippet queries related laravel