本文整理汇总了PHP中app\Company::update方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::update方法的具体用法?PHP Company::update怎么用?PHP Company::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Company
的用法示例。
在下文中一共展示了Company::update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: update
/**
* 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');
}
示例2: store
/**
* 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();
}
示例3: update
/**
* 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'));
}
示例4: 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');
}