app/Http/Controllers/Admin/generalsettingsController.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(GeneralValidator $request)
    {
        if ($request->hasFile('website_logo')) {
            $image = $request->file('website_logo');
            $logo = "LOGO-" . time() . '.' . $image->getClientOriginalExtension();
            $image->move('public/images/GeneralSettings/', $logo);
        }
        $general = new GeneralSetting([
            'user_id' => $request->user_id,
            'website_name' => $request->website_name,
            'website_link' => $request->website_link,
            'emailaddress' => $request->emailaddress,
        ]);
        $general->website_logo = $logo;
       $data= $general->save();
        if($data){
            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 store ( GeneralValidator $ request ) { if ( $ request -> hasFile ( 'website_logo' ) ) { $ image = $ request -> file ( 'website_logo' ) ; $ logo = " LOGO- " . time ( ) . '.' . $ image -> getClientOriginalExtension ( ) ; $ image -> move ( 'public/images/GeneralSettings/' , $ logo ) ; } $ general = new GeneralSetting ( [ 'user_id' => $ request -> user_id , 'website_name' => $ request -> website_name , 'website_link' => $ request -> website_link , 'emailaddress' => $ request -> emailaddress , ] ) ; $ general -> website_logo = $ logo ; $ data = $ general -> save ( ) ; if ( $ data ) { 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.' ) ; } }
Store a newly created resource in storage.
Store a newly created resource in storage .