app/Http/Controllers/TuteurController.php
/**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
Store a newly created resource in storage.
Store a newly created resource in storage .
public function store(Request $request)
    {
        $data= request()->validate([
            'prenom'=>'required',
            'nom'=>'required',
            'telephone'=>'required',
            'email'=>'email',
            'adresse'=> 'max:100',
            'sexe'=>'required',
          ]);
           $tuteur = Tuteur::create($data);
           return redirect('/tuteurs/'.$tuteur->id);
    }
public function store ( Request $ request ) { $ data = request ( ) -> validate ( [ 'prenom' => 'required' , 'nom' => 'required' , 'telephone' => 'required' , 'email' => 'email' , 'adresse' => 'max:100' , 'sexe' => 'required' , ] ) ; $ tuteur = Tuteur :: create ( $ data ) ; return redirect ( '/tuteurs/' . $ tuteur -> id ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .