app/Http/Controllers/Admin/generalsettingsController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(GeneralValidator $request, $id)
    {
        $general = GeneralSetting::findorfail($id);
        if ($request->hasFile('website_logo')) {
            $image = $request->file('website_logo');
            $logo = "LOGO-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/GeneralSettings/', $logo);
            $general->website_logo = $logo;
        }
        $general->user_id = $request->input('user_id');
        $general->website_name = $request->input('website_name');
        $general->website_link = $request->input('website_link');
        $general->emailaddress = $request->input('emailaddress');
        $update=$general->save();
        if($update)
        {
            return redirect()->route('generalsettings.create')->with('success','General Settings added successfully !!!');
        }else {
            return redirect()->back()->with('error', 'There occurred some problem , please try again after a while.');
        }
    }
public function update ( GeneralValidator $ request , $ id ) { $ general = GeneralSetting :: findorfail ( $ id ) ; if ( $ request -> hasFile ( 'website_logo' ) ) { $ image = $ request -> file ( 'website_logo' ) ; $ logo = " LOGO- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/GeneralSettings/' , $ logo ) ; $ general -> website_logo = $ logo ; } $ general -> user_id = $ request -> input ( 'user_id' ) ; $ general -> website_name = $ request -> input ( 'website_name' ) ; $ general -> website_link = $ request -> input ( 'website_link' ) ; $ general -> emailaddress = $ request -> input ( 'emailaddress' ) ; $ update = $ general -> save ( ) ; if ( $ update ) { return redirect ( ) -> route ( 'generalsettings.create' ) -> with ( 'success' , 'General Settings added successfully !!!' ) ; } else { return redirect ( ) -> back ( ) -> with ( 'error' , 'There occurred some problem , please try again after a while.' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .