app/Http/Controllers/FooterController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\Models\Footer  $footer
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, Footer $footer)
    {
        $this->authorize("update", Footer::class);
        request()->validate([
            "adresse"=>["required"],
            "phone"=>["required"],
            "email"=>["required"],
            "linkTitre1"=>["required"],
            "link1"=>["required"],
            "link2"=>["required"],
            "link3"=>["required"],
            "link4"=>["required"],
            "link5"=>["required"],
            "linkTitre2"=>["required"],
            "link6"=>["required"],
            "link7"=>["required"],
            "link8"=>["required"],
            "link9"=>["required"],
            "link10"=>["required"],
            "titre"=>["required"],
            "description"=>["required"],
        ]);
        $footer->adresse = $request->adresse;
        $footer->phone = $request->phone;
        $footer->email = $request->email;
        $footer->linkTitre1 = $request->linkTitre1;
        $footer->link1 = $request->link1;
        $footer->link2 = $request->link2;
        $footer->link3 = $request->link3;
        $footer->link4 = $request->link4;
        $footer->link5 = $request->link5;
        $footer->linkTitre2 = $request->linkTitre2;
        $footer->link6 = $request->link6;
        $footer->link7 = $request->link7;
        $footer->link8 = $request->link8;
        $footer->link9 = $request->link9;
        $footer->link10 = $request->link10;
        $footer->titre = $request->titre;
        $footer->description = $request->description;
        $footer->save();
        return redirect('/');
    }
public function update ( Request $ request , Footer $ footer ) { $ this -> authorize ( " update " , Footer :: class ) ; request ( ) -> validate ( [ " adresse " => [ " required " ] , " phone " => [ " required " ] , " email " => [ " required " ] , " linkTitre1 " => [ " required " ] , " link1 " => [ " required " ] , " link2 " => [ " required " ] , " link3 " => [ " required " ] , " link4 " => [ " required " ] , " link5 " => [ " required " ] , " linkTitre2 " => [ " required " ] , " link6 " => [ " required " ] , " link7 " => [ " required " ] , " link8 " => [ " required " ] , " link9 " => [ " required " ] , " link10 " => [ " required " ] , " titre " => [ " required " ] , " description " => [ " required " ] , ] ) ; $ footer -> adresse = $ request -> adresse ; $ footer -> phone = $ request -> phone ; $ footer -> email = $ request -> email ; $ footer -> linkTitre1 = $ request -> linkTitre1 ; $ footer -> link1 = $ request -> link1 ; $ footer -> link2 = $ request -> link2 ; $ footer -> link3 = $ request -> link3 ; $ footer -> link4 = $ request -> link4 ; $ footer -> link5 = $ request -> link5 ; $ footer -> linkTitre2 = $ request -> linkTitre2 ; $ footer -> link6 = $ request -> link6 ; $ footer -> link7 = $ request -> link7 ; $ footer -> link8 = $ request -> link8 ; $ footer -> link9 = $ request -> link9 ; $ footer -> link10 = $ request -> link10 ; $ footer -> titre = $ request -> titre ; $ footer -> description = $ request -> description ; $ footer -> save ( ) ; return redirect ( '/' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .