app/Http/Controllers/Main_Controller/CompanyProfileController.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(Request $request)
    {
        $company = new CompanyProfile();
        $company->name=$request->company;
        $company->address=$request->address;
        $company->contact=$request->contact;
        $company->license=$request->license;
        $company->owner=$request->owner;
        $company->vat=$request->vatno;
        $profileimage=$request->logo;
        if($request->hasFile('logo')){
            $x = 'abcdefghijklmnopqrstuvwxyz0123456789';
            $x = str_shuffle($x);
            $x = substr($x, 0, 6) . '.PI_S.';
            $profileImageFilename = time() . $x . $profileimage->getClientOriginalExtension();
            Image::make($profileimage->getRealPath())->resize(250, 200)->save(public_path('/Media/company_profile/' . $profileImageFilename));
            $company->image=$profileImageFilename;
        }
        $company->save();
        $notification=array(
            'messege'=>'Successfully Company Profile Updated!',
            'alert-type'=>'success'
        );
        return Redirect()->back()->with($notification);
    }
public function store ( Request $ request ) { $ company = new CompanyProfile ( ) ; $ company -> name = $ request -> company ; $ company -> address = $ request -> address ; $ company -> contact = $ request -> contact ; $ company -> license = $ request -> license ; $ company -> owner = $ request -> owner ; $ company -> vat = $ request -> vatno ; $ profileimage = $ request -> logo ; if ( $ request -> hasFile ( 'logo' ) ) { $ x = 'abcdefghijklmnopqrstuvwxyz0123456789' ; $ x = str_shuffle ( $ x ) ; $ x = substr ( $ x , 0 , 6 ) . '.PI_S.' ; $ profileImageFilename = time ( ) . $ x . $ profileimage -> getClientOriginalExtension ( ) ; Image :: make ( $ profileimage -> getRealPath ( ) ) -> resize ( 250 , 200 ) -> save ( public_path ( '/Media/company_profile/' . $ profileImageFilename ) ) ; $ company -> image = $ profileImageFilename ; } $ company -> save ( ) ; $ notification = array ( 'messege' => 'Successfully Company Profile Updated!' , 'alert-type' => 'success' ) ; return Redirect ( ) -> back ( ) -> with ( $ notification ) ; }
Store a newly created resource in storage.
Store a newly created resource in storage .