THIS IS THE ROUTERoute::get('detail/{id}',[DirecteurController::class,'detail']);
HERE THE FUNCTION
function detail($id){ echo $id; }
AND HERE IS THE BLADE PART
`@foreach ($liste as $item)
<a href="detail/{{ $item->id}}" class="btn btn-info nav-icon fas fa-eye"></a>
<a href="" class="btn btn-danger nav-icon fas fa-user"></a>
</td>
@endforeach`
Route::get('detail/{id}',[DirecteurController::class,'detail'])->name('directeur.details');
@foreach ($liste as $item)
<a href="{{route('directeur.details',['id' => $item->id])}}" class="btn btn-info nav-icon fas fa-eye"></a>
<a href="" class="btn btn-danger nav-icon fas fa-user"></a>
</td>
@endforeach
maybe because you are using a relative path without root, try to add "/" to the url
<a href="detail/{{ $item->id}}" class="btn btn-info nav-icon fas fa-eye"></a>
and you should using named route instead
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.