當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Company::update方法代碼示例

本文整理匯總了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');
 }
開發者ID:stoic1979,項目名稱:laravel_trucks,代碼行數:14,代碼來源:CompanyController.php

示例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();
 }
開發者ID:wyrover,項目名稱:applications,代碼行數:47,代碼來源:AdminController.php

示例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'));
 }
開發者ID:khanhpnk,項目名稱:sbds,代碼行數:12,代碼來源:CompanyController.php

示例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');
 }
開發者ID:figura4,項目名稱:c64,代碼行數:15,代碼來源:CompanyController.php


注:本文中的app\Company::update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。