app/Http/Controllers/DeuxiemeSectionController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\DeuxiemeSection  $deuxiemeSection
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $this->authorize("update", DeuxiemeSection::class);
        request()->validate([
            "chemin"=>["required"],
            "logo"=>["required"],
            "titre"=>["required"],
            "description"=>["required"]
        ]);
        $deuxiemeSection = DeuxiemeSection::find($id);
        $deuxiemeSection->chemin = $request->chemin;
        $deuxiemeSection->logo = $request->logo;
        $deuxiemeSection->titre = $request->titre;
        $deuxiemeSection->description = $request->description;
        $deuxiemeSection->save();
        return redirect('/');
    }
public function update ( Request $ request , $ id ) { $ this -> authorize ( " update " , DeuxiemeSection :: class ) ; request ( ) -> validate ( [ " chemin " => [ " required " ] , " logo " => [ " required " ] , " titre " => [ " required " ] , " description " => [ " required " ] ] ) ; $ deuxiemeSection = DeuxiemeSection :: find ( $ id ) ; $ deuxiemeSection -> chemin = $ request -> chemin ; $ deuxiemeSection -> logo = $ request -> logo ; $ deuxiemeSection -> titre = $ request -> titre ; $ deuxiemeSection -> description = $ request -> description ; $ deuxiemeSection -> save ( ) ; return redirect ( '/' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .