/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(Request $request, Company $company) { $input = array_except(Input::all(), '_method'); $company->update($input); Session::flash('flash_message', 'Company updated successfully!'); return Redirect::route('company.index')->with('message', 'Company updated'); }
/** * Store new account * */ public function store(Request $request) { $user = new User(); $user->name = $request->input('name'); $user->username = $request->input('username'); $user->email = $request->input('email'); $pass = $request->input('password'); $user->role = 'Owner'; if (!empty($pass)) { $user->password = bcrypt($pass); } $user->save(); // Create Company $company = new Company(); $company->name = $request->input('company_name'); $company->email = $request->input('company_email'); $company->address1 = $request->input('address1'); $company->address2 = $request->input('address2'); $company->city = $request->input('city'); $company->postcode = $request->input('postcode'); $company->url = strtolower(str_replace(' ', '', $request->input('company_name'))); $company->save(); $user->company_id = $company->id; $user->update(); $company->user_id = $user->id; $company->update(); $settings = new Settings(); $settings->application_id = 1; $settings->references_id = 0; $settings->company_id = $company->id; $settings->save(); $refs = new ReferenceFields(); $refs->settings_id = $settings->id; $refs->company_id = $company->id; $refs->save(); $options = new Settings(); $options->references_id = 1; $options->application_id = 0; $options->company_id = $company->id; $options->save(); flash()->success('Success', 'Account successfully created'); return back(); }
/** * Update the specified resource in storage. * * @param CompanyRequest $request * @param Company $company * @return Response */ public function update(CompanyRequest $request, Company $company) { $company->update($request->all()); return redirect('quan-tri/cong-ty')->with('flash_message', Lang::get('system.update')); }
/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param Developer $developer * @param StoreDeveloperRequest $validationRequest * @return \Illuminate\Http\Response */ public function update(StoreCompanyRequest $request, Company $company) { $input = array_except(Input::all(), '_method'); $company->update($input); Session::flash('message', 'Company upated'); return redirect('/company'); }