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


PHP Company::find方法代碼示例

本文整理匯總了PHP中app\Company::find方法的典型用法代碼示例。如果您正苦於以下問題:PHP Company::find方法的具體用法?PHP Company::find怎麽用?PHP Company::find使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Company的用法示例。


在下文中一共展示了Company::find方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: updateCompany

 public function updateCompany(Request $request)
 {
     $company = Company::find(Auth::user()->company_id);
     if ($request->has('company-name')) {
         $company->name = $request->input('company-name');
     }
     if ($request->has('address')) {
         $company->address = $request->input('address');
     }
     if ($request->has('city')) {
         $company->city = $request->input('city');
     }
     if ($request->has('state')) {
         $company->state = $request->input('state');
     }
     if ($request->has('zip')) {
         $company->zip = $request->input('zip');
     }
     if ($request->has('email')) {
         $company->email = $request->input('email');
     }
     if ($request->has('phone')) {
         $company->phone = $request->input('phone');
     }
     $request->session()->flash('success', 'Company Updated!');
     $company->save();
     $team = User::where('company_id', $company->id)->where('user_type', 2)->get();
     return view('manage.company', ['company' => Company::find(Auth::user()->company_id), 'team' => $team]);
 }
開發者ID:sipplified,項目名稱:AuditionAnswer,代碼行數:29,代碼來源:ManageController.php

示例2: showSettings

 public function showSettings()
 {
     $companies = \App\Company::all()->lists('name', 'id');
     $current_company = \App\Company::find(Auth::user()->current_company);
     //        dd($current_company);
     return view('settings.settings', compact('companies', 'current_company'));
 }
開發者ID:johanWP,項目名稱:pandora,代碼行數:7,代碼來源:SettingsController.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param int $id
  *
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $data = $request->except(['created_at', 'deleted_at']);
     $company = Company::find($id);
     $company->update($data);
     return redirect()->to('wpanel/profile');
 }
開發者ID:softsolution,項目名稱:antVel,代碼行數:14,代碼來源:CompanyController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     // $this->validate($request, $this->form_rules);
     $data = ['name' => $request->input('name'), 'website_name' => $request->input('website_name'), 'slogan' => $request->input('slogan'), 'phone_number' => $request->input('phone_number'), 'cell_phone' => $request->input('cell_phone'), 'address' => $request->input('address'), 'state' => $request->input('state'), 'city' => $request->input('city'), 'facebook' => $request->input('facebook'), 'facebook_app_id' => $request->input('facebook_app_id'), 'twitter' => $request->input('twitter'), 'zip_code' => $request->input('zip_code'), 'google_maps_key_api' => $request->input('google_maps_key_api'), 'email' => $request->input('email'), 'contact_email' => $request->input('contact_email'), 'sales_email' => $request->input('sales_email'), 'support_email' => $request->input('support_email'), 'description' => $request->input('description'), 'keywords' => $request->input('keywords'), 'about_us' => $request->input('about_us'), 'refund_policy' => $request->input('refund_policy'), 'privacy_policy' => $request->input('privacy_policy'), 'terms_of_service' => $request->input('terms_of_service')];
     $company = Company::find($id);
     $company->update($data);
     return redirect()->to('wpanel/profile');
 }
開發者ID:rolka,項目名稱:antVel,代碼行數:14,代碼來源:CompanyController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     //
     $company = Company::find($id);
     $data = $request->except(['_token', '_method']);
     //dd($data);
     $company->update($data);
     return redirect()->to('company');
 }
開發者ID:sunhuang2015,項目名稱:feotask,代碼行數:16,代碼來源:CompanyController.php

示例6: loadCompany

 public static function loadCompany($id)
 {
     $company = Company::find($id);
     if (!empty($company)) {
         if (intval(Auth::id()) !== intval($company->user_id)) {
             $company = null;
         }
     }
     return $company;
 }
開發者ID:enspdf,項目名稱:billr,代碼行數:10,代碼來源:Company.php

示例7: edit

 public function edit($user_id, Request $request)
 {
     $start_time = $request->get('start') ? date("Y-m-d", strtotime($request->get('start') . " -1 day")) : date("Y-m-d", strtotime("-1 month -1 day"));
     $end_time = $request->get('end') ? date("Y-m-d", strtotime($request->get('end') . " +1 day")) : date("Y-m-d", strtotime("+1 day"));
     $company_id = Auth::user()->role == "supadmin" ? $request->get('company_id') : $this->company_id[0];
     $email = User::where('id', $user_id)->select('email')->pluck('email');
     $currency = Company::find($company_id)->currency->title;
     $data = Payment::shifts($user_id, $company_id, $start_time, $end_time);
     return view('payment.shifts')->with(['data' => $data, 'currency' => $currency, 'user_email' => $email, 'user_id' => $user_id, 'user_company_id' => $company_id]);
 }
開發者ID:svetlinyotov,項目名稱:Timeline_v2.0,代碼行數:10,代碼來源:PaymentsController.php

示例8: getApprove

 public function getApprove($id)
 {
     if (!$this->entrust->hasRole("super_admin")) {
         return Redirect::back()->with("error", "You are Not authorized to perform This action");
     }
     $company = Company::find($id);
     $company->status = "approved";
     $company->save();
     return Redirect::back()->with("success", "Company Has Been Approved successfully");
 }
開發者ID:younggeeks,項目名稱:twentyKitonga,代碼行數:10,代碼來源:CompanyController.php

示例9: test_new_company_is_suspended

 public function test_new_company_is_suspended()
 {
     $company = factory(Company::class)->create();
     $this->seeInDatabase('companies', ['id' => $company->id, 'is_suspended' => true]);
     $company->is_suspended = false;
     $company->save();
     $this->seeInDatabase('companies', ['id' => $company->id, 'is_suspended' => false]);
     $companyAgain = Company::find($company->id);
     $this->assertEquals(false, (bool) $companyAgain->is_suspended);
 }
開發者ID:vukanac,項目名稱:l5-admin-panel,代碼行數:10,代碼來源:CompanyLicenceManagementTest.php

示例10: delete

 public function delete(Request $request)
 {
     try {
         $this->validate($request, ['id' => 'required']);
         $company = Company::find($request->id);
         $company->forceDelete();
         return response(1, 200);
     } catch (\Exception $e) {
         return response(0, 400);
     }
 }
開發者ID:rtorralba,項目名稱:companies,代碼行數:11,代碼來源:MainController.php

示例11: getEdit

 public function getEdit($id)
 {
     $agreement = Agreement::find($id);
     $company = Company::find($agreement->company_id);
     $clients = $company->clients()->selectRaw('CONCAT(name, " (Cli)") name_type, id')->lists('name_type', 'id')->all();
     $providers = $company->providers()->selectRaw('CONCAT(name, " (Pro)") name_type, id')->lists('name_type', 'id')->all();
     $companies = $clients + $providers;
     $companies_selected = $agreement->companies()->getRelatedIds()->all();
     $data = array('agreement' => $agreement, 'companies' => $companies, 'companies_selected' => $companies_selected);
     return view('admin.agreement.edit', $data);
 }
開發者ID:rtorralba,項目名稱:companies,代碼行數:11,代碼來源:AgreementController.php

示例12: update

 public function update($id)
 {
     $input = \Input::all();
     $v = \Validator::make($input['company'], \App\Company::$updateRules);
     if ($v->fails()) {
         return \Redirect::route('companies.edit', ['id' => $id])->withErrors($v->errors())->withInput();
     }
     $company = \App\Company::find($id);
     $company->update($input['company']);
     return \Redirect::route('companies.show', ['company' => $company]);
 }
開發者ID:bhargavjoshi,項目名稱:timesheet,代碼行數:11,代碼來源:CompaniesController.php

示例13: destroy

 public function destroy($id)
 {
     $company = Company::find($id);
     if (!$company) {
         return response()->json(['message' => 'Record not found'], 404);
     }
     if (\Auth::user()->id != $company->id) {
         return response()->json(['message' => 'You haven\'t permission to delete this entry'], 401);
     }
     return response()->json($company->delete(), 204);
 }
開發者ID:rafaell-lycan,項目名稱:laravel-jobs-api,代碼行數:11,代碼來源:CompaniesController.php

示例14: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     Blade::directive('hasrole', function ($expression) {
         $expression = explode(',', str_replace(['(', ')', "'"], '', $expression));
         return '<?php if(' . (Auth::user() && Auth::user()->hasRole($expression) ? 1 : 0) . '): ?>';
     });
     Blade::directive('endhasrole', function () {
         return '<?php endif; ?>';
     });
     $table = 'company';
     if (\Schema::hasTable($table)) {
         $main_company = Company::find(1);
         \View::share('main_company', $main_company);
     }
 }
開發者ID:ant-vel,項目名稱:Web,代碼行數:20,代碼來源:AppServiceProvider.php

示例15: boot

 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     $table = "company";
     if (\Schema::hasTable($table)) {
         $main_company = Company::find(1)->toArray();
         $categories_menu = \Cache::remember('categories_mothers', 25, function () {
             return Category::select('id', 'name')->childsOf('mothers')->actives()->get()->toArray();
         });
         $menu = [];
         foreach ($categories_menu as $value) {
             $menu[$value['id']] = $value;
         }
         \View::share('main_company', $main_company);
         \View::share('categories_menu', $menu);
     }
 }
開發者ID:rolka,項目名稱:antVel,代碼行數:21,代碼來源:AppServiceProvider.php


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