app/Http/Controllers/EleveController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Eleve  $eleve
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $data= request()->validate([
            'prenom'=>'required',
            'nom'=>'required',
            'naissance'=>'required',
            'sexe'=>'required',
            'niveau'=> 'required',
            'tuteur_id'=> 'required',
          ]);
          $eleve = Eleve::find($id);
          $eleve->update($data);
          return redirect('eleves/'.$eleve->id); 
    }
public function update ( Request $ request , $ id ) { $ data = request ( ) -> validate ( [ 'prenom' => 'required' , 'nom' => 'required' , 'naissance' => 'required' , 'sexe' => 'required' , 'niveau' => 'required' , 'tuteur_id' => 'required' , ] ) ; $ eleve = Eleve :: find ( $ id ) ; $ eleve -> update ( $ data ) ; return redirect ( 'eleves/' . $ eleve -> id ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// dd(intval($request->input('niveau')));