app/Http/Controllers/AboutController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \App\About  $about
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, About $about)
    {
        $data=request()->validate([
            'about_heading'=>'required',
            'about_image'=>'required',
            'about_desc'=>'required',
            'service_heading'=>'required',
            'service_head_desc'=>'required',
            'partners_heading'=>'required',
            'partners_head_desc'=>'required',
            'about_title'=>'required',
        ]);
        $id=auth()->user()->id;
        $name=auth()->user()->name;
        if (request('about_image')){
            $imagePath = request('about_image')->store('AboutImages', 'public');
            $image = Image::make("storage/{$imagePath}")->fit(555, 600);
            $data = array_merge($data,['about_image'=>$imagePath,'user_id'=>$id,'created_by'=>$name]);
        }
        $about->update($data);
        return redirect('/abouts');
    }
public function update ( Request $ request , About $ about ) { $ data = request ( ) -> validate ( [ 'about_heading' => 'required' , 'about_image' => 'required' , 'about_desc' => 'required' , 'service_heading' => 'required' , 'service_head_desc' => 'required' , 'partners_heading' => 'required' , 'partners_head_desc' => 'required' , 'about_title' => 'required' , ] ) ; $ id = auth ( ) -> user ( ) -> id ; $ name = auth ( ) -> user ( ) -> name ; if ( request ( 'about_image' ) ) { $ imagePath = request ( 'about_image' ) -> store ( 'AboutImages' , 'public' ) ; $ image = Image :: make ( " storage/ { $ imagePath } " ) -> fit ( 555 , 600 ) ; $ data = array_merge ( $ data , [ 'about_image' => $ imagePath , 'user_id' => $ id , 'created_by' => $ name ] ) ; } $ about -> update ( $ data ) ; return redirect ( '/abouts' ) ; }
Update the specified resource in storage.
Update the specified resource in storage .