Home > front end >  How i can solve Uncaught SyntaxError: Unexpected token '<' error
How i can solve Uncaught SyntaxError: Unexpected token '<' error

Time:05-23

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

CodePudding user response:

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'));
          
}

CodePudding user response:

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'));}
  • Related