public function profile_submit() { $data = \Request::all(); if (isset($data['image'])) { $file_name = \Common::get_img_filename($data['image']); \Common::make_square_img($file_name, 140); $res = \Common::s3_upload($file_name, 'person/'); if ($res['success']) { $person = Person::find(\Auth::user()->id); $person->image = $res['filename']; $person->save(); } } return \Redirect()->action('PersonController@profile'); }
public function edit_submit() { $data = \Request::all(); $company = Company::find(\Request::input('company_id')); $company->name = $data['name']; if (isset($data['image'])) { $file_name = \Common::get_img_filename($data['image']); \Common::make_square_img($file_name, 140); $res = \Common::s3_upload($file_name, 'company/'); if ($res['success']) { $company->ci = $res['filename']; } } $company->status = $data['status_group']; $company->save(); return \Redirect()->action('CompanyController@index'); }