/** * Update the specified resource in storage. * @param type int $id * @param type Company $company * @param type CompanyRequest $request * @return Response */ public function postcompany($id, Company $company, CompanyRequest $request) { try { /* fetch the values of company request */ $companys = $company->whereId('1')->first(); if (Input::file('logo')) { $name = Input::file('logo')->getClientOriginalName(); $destinationPath = 'lb-faveo/dist/'; $fileName = rand(00, 9999) . '.' . $name; Input::file('logo')->move($destinationPath, $fileName); $companys->logo = $fileName; } if ($request->input('use_logo') == null) { $companys->use_logo = '0'; } /* Check whether function success or not */ if ($companys->fill($request->except('logo'))->save() == true) { /* redirect to Index page with Success Message */ return redirect('getcompany')->with('success', 'Company Updated Successfully'); } else { /* redirect to Index page with Fails Message */ return redirect('getcompany')->with('fails', 'Company can not Updated'); } } catch (Exception $e) { /* redirect to Index page with Fails Message */ return redirect('getcompany')->with('fails', 'Company can not Updated'); } }