Use named route.
<a href="{{ route('edit.category', ['id' => $cat->id]) }}" class="btn btn-primary btn-sm float-left">Edit</a>
And run
php artisan route:clear
Because you have cached routes and never do that during development.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am trying to use this route I made but its not registering on php artisan route:list so when I click the link, it says not found. What am I doing wrong?
Route::get('/category/edit/{id}',[CategoryController::class,'EditCat'])->name('edit.category');
Controller
public function EditCat($id){
$categories = Category::find($id);
return view('admin.category.edit',compact('categories'));
}
Link
<a href="{{ url('/category/edit/'.$cat->id) }}" class="btn btn-primary btn-sm float-left">Edit</a>
Use named route.
<a href="{{ route('edit.category', ['id' => $cat->id]) }}" class="btn btn-primary btn-sm float-left">Edit</a>
And run
php artisan route:clear
Because you have cached routes and never do that during development.
Please or to participate in this conversation.