'How i can solve Uncaught SyntaxError: Unexpected token '<' error
This is my route:
Route::delete('/projet/update/{id_projet}',[listProjetController::class,"edit"])->name('projet.edit');
and this my controller :
public function edit($id)
{
$projet = projet::where('id_projet',$id)->first();
return view('chef_projet.projetUpdate',compact('projet'));
}
but css and javascript do not work in my view, the error looks like this : console error log
Solution 1:[1]
You need to change your method in controller as
public function edit($id_projet) {
$projet = projet::where('id_projet',$id_projet)->first();
return view('chef_projet.projetUpdate',compact('projet'));
}
Solution 2:[2]
In route you are passing $id_project and in fuction u r getting $id which it cant find thats why its giving error
public function edit($id_projet){
$projet = projet::where('id_projet',$id_projet)->first();
return view('chef_projet.projetUpdate',compact('projet'));}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Vinod Patidar |
| Solution 2 | Hashir Muzaffar |
