当前位置: 首页>>代码示例>>PHP>>正文


PHP Contact::where方法代码示例

本文整理汇总了PHP中app\models\Contact::where方法的典型用法代码示例。如果您正苦于以下问题:PHP Contact::where方法的具体用法?PHP Contact::where怎么用?PHP Contact::where使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在app\models\Contact的用法示例。


在下文中一共展示了Contact::where方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 /**
  * Update Contact attributes.
  *
  * @param Business $business
  * @param Contact  $contact
  * @param array    $data
  * @param string   $notes
  *
  * @return void
  */
 public function update(Business $business, Contact $contact, $data = [], $notes = null)
 {
     if (array_key_exists('birthdate', $data) && trim($data['birthdate']) != '') {
         $data['birthdate'] = Carbon::createFromFormat(trans('app.dateformat.carbon'), $data['birthdate']);
     }
     $contact->where('id', '=', $contact->id)->update($data);
     self::updateNotes($business, $contact, $notes);
 }
开发者ID:zeke8402,项目名称:timegrid,代码行数:18,代码来源:ContactService.php

示例2: homepage

 public function homepage()
 {
     $params = array('logo' => Title::findOrFail(1), 'timer' => Timer::findOrFail(1), 'about' => About::findOrFail(1), 'contacts' => Contact::where('enabled', '=', true)->orderBy('id', 'ASC')->get(), 'grouped' => GroupRepository::grouped(), 'offices' => Office::where('enabled', '=', true)->orderBy('position', 'ASC')->get(), 'title' => 'TWIGA – крупнейшая независимая коммуникационная группа в России и странах СНГ');
     /*if (Request::has('r')) {
     			$r = Request::get('r');
     			Session::set('r', $r);
     
     			return redirect('/#' . $r);
     		}*/
     $view = Agent::isTablet() || Request::has('t') ? 'tablet.homepage' : (Agent::isMobile() || Request::has('m') ? 'mobile.homepage' : 'index.homepage');
     return view($view, $params);
 }
开发者ID:Quiss,项目名称:Twiga,代码行数:12,代码来源:IndexController.php

示例3: getCredentials

 /**
  * Get the needed authorization credentials from the request.
  *
  * @param  \Illuminate\Http\Request $request
  *
  * @return array
  */
 protected function getCredentials(Request $request)
 {
     $credentials = $request->only('password');
     $credentials['id'] = null;
     $contactKey = session('contact_key');
     if ($contactKey) {
         $contact = Contact::where('contact_key', '=', $contactKey)->first();
         if ($contact && !$contact->is_deleted) {
             $credentials['id'] = $contact->id;
         }
     }
     return $credentials;
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:20,代码来源:AuthController.php

示例4: search

 public function search(Request $request)
 {
     $q = $request->input('search');
     if (preg_match("/^[0-9]+\$/", $q)) {
         $data = ['title' => 'Список контактов', 'view_all' => false, 'contacts' => Contact::get()->where('phone', $q)->toArray()];
         return view('templates.index', $data);
     } elseif (filter_var($q, FILTER_VALIDATE_EMAIL)) {
         $data = ['title' => 'Список контактов', 'view_all' => false, 'contacts' => Contact::where('email', $q)->get()->toArray()];
         return view('templates.index', $data);
     } else {
         $q = '%' . $q . '%';
         $data = ['title' => 'Список контактов', 'view_all' => false, 'contacts' => Contact::where('fullname', 'LIKE', $q)->get()->toArray()];
         //dd($data);
         return view('templates.index', $data);
     }
 }
开发者ID:artemzhilin,项目名称:testlaravel,代码行数:16,代码来源:HomeController.php

示例5: compose

 /**
  * Bind data to the view.
  *
  * @param  View  $view
  *
  * @return void
  */
 public function compose(View $view)
 {
     $contactKey = session('contact_key');
     if (!$contactKey) {
         return false;
     }
     $contact = Contact::where('contact_key', '=', $contactKey)->with('client')->first();
     if (!$contact || $contact->is_deleted) {
         return false;
     }
     $client = $contact->client;
     $hasDocuments = DB::table('invoices')->where('invoices.client_id', '=', $client->id)->whereNull('invoices.deleted_at')->join('documents', 'documents.invoice_id', '=', 'invoices.id')->count();
     $view->with('hasQuotes', $client->quotes->count());
     $view->with('hasCredits', $client->creditsWithBalance->count());
     $view->with('hasDocuments', $hasDocuments);
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:23,代码来源:ClientPortalHeaderComposer.php

示例6: reset

 /**
  * Reset the given user's password.
  *
  * @param  \Illuminate\Http\Request $request
  * @return \Illuminate\Http\Response
  */
 public function reset(Request $request)
 {
     $this->validate($request, $this->getResetValidationRules());
     $credentials = $request->only('password', 'password_confirmation', 'token');
     $credentials['id'] = null;
     $contactKey = session('contact_key');
     if ($contactKey) {
         $contact = Contact::where('contact_key', '=', $contactKey)->first();
         if ($contact && !$contact->is_deleted) {
             $credentials['id'] = $contact->id;
         }
     }
     $broker = $this->getBroker();
     $response = Password::broker($broker)->reset($credentials, function ($user, $password) {
         $this->resetPassword($user, $password);
     });
     switch ($response) {
         case Password::PASSWORD_RESET:
             return $this->getResetSuccessResponse($response);
         default:
             return $this->getResetFailureResponse($request, $response);
     }
 }
开发者ID:hillelcoren,项目名称:invoice-ninja,代码行数:29,代码来源:PasswordController.php

示例7: getContact

 private function getContact()
 {
     $contactKey = session('contact_key');
     if (!$contactKey) {
         return false;
     }
     $contact = Contact::where('contact_key', '=', $contactKey)->first();
     if (!$contact || $contact->is_deleted) {
         return false;
     }
     return $contact;
 }
开发者ID:rafaelsisweb,项目名称:invoice-ninja,代码行数:12,代码来源:ClientPortalController.php

示例8: linkToContacts

 /**
  * Link User to existing Contacts
  * 
  * @return boolean   The User was linked to at least one Contact
  */
 public function linkToContacts()
 {
     $contacts = Contact::where(['email' => $this->email])->whereNotNull('email')->whereNull('user_id')->get();
     if ($contacts->isEmpty()) {
         return false;
     }
     foreach ($contacts as $contact) {
         $contact->user()->associate($this)->save();
     }
     return true;
 }
开发者ID:ancchaimongkon,项目名称:timegrid,代码行数:16,代码来源:User.php

示例9: findExistingContactsByUserId

 /**
  * Find an existing Contact By UserId.
  * 
  * @param int $userId
  *
  * @return Collection|Builder
  */
 protected function findExistingContactsByUserId($userId)
 {
     return Contact::where('user_id', '=', $userId)->get();
 }
开发者ID:zeke8402,项目名称:timegrid,代码行数:11,代码来源:BusinessContactController.php


注:本文中的app\models\Contact::where方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。