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


PHP UserRepository::pushCriteria方法代碼示例

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


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

示例1: postEmail

 /**
  * Send a reset link to the given user.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postEmail(Request $request)
 {
     $this->validate($request, ['email' => 'required|email']);
     $email = $request->input('email');
     $user = $this->user->pushCriteria(new UserWhereEmailEquals($email))->all()->first();
     Audit::log(null, trans('passwords.audit-log.category'), trans('passwords.audit-log.msg-request-reset', ['email' => $email]));
     if (is_null($user)) {
         Flash::error(trans(Password::INVALID_USER));
         return redirect()->back();
     } elseif ($user->auth_type !== 'internal') {
         Flash::error(trans('passwords.auth_type'));
         return redirect()->back();
     } else {
         $response = Password::sendResetLink($request->only('email'), function (Message $message) {
             $message->subject($this->getEmailSubject());
         });
         switch ($response) {
             case Password::RESET_LINK_SENT:
                 Flash::success(trans($response));
                 return redirect()->back()->with('status', trans($response));
             case Password::INVALID_USER:
                 Flash::error(trans($response));
                 return redirect()->back()->withErrors(['email' => trans($response)]);
         }
     }
 }
開發者ID:sroutier,項目名稱:laravel-5.1-enterprise-starter-kit,代碼行數:32,代碼來源:PasswordController.php

示例2: index

 /**
  * Display a listing of the User.
  *
  * @param Request $request
  * @return Response
  */
 public function index(Request $request)
 {
     $this->authorize('users.view');
     $this->userRepository->pushCriteria(new RequestCriteria($request));
     $users = $this->userRepository->paginate(50);
     return view('users.index')->with('users', $users);
 }
開發者ID:exfriend,項目名稱:larabox,代碼行數:13,代碼來源:UserController.php

示例3: index

 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $page_title = trans('admin/users/general.page.index.title');
     // "Admin | Users";
     $page_description = trans('admin/users/general.page.index.description');
     // "List of users";
     $users = $this->user->pushCriteria(new UsersWithRoles())->pushCriteria(new UsersByUsernamesAscending())->paginate(10);
     return view('admin.users.index', compact('users', 'page_title', 'page_description'));
 }
開發者ID:slakbal,項目名稱:laravel-5.1-enterprise-starter-kit,代碼行數:12,代碼來源:UsersController.php

示例4: searchByName

 public function searchByName(Request $request)
 {
     $return_arr = null;
     $query = $request->input('query');
     $users = $this->user->pushCriteria(new UsersWhereFirstNameOrLastNameOrUsernameLike($query))->all();
     foreach ($users as $user) {
         $id = $user->id;
         $first_name = $user->first_name;
         $last_name = $user->last_name;
         $username = $user->username;
         $entry_arr = ['id' => $id, 'text' => "{$first_name} {$last_name} ({$username})"];
         $return_arr[] = $entry_arr;
     }
     return $return_arr;
 }
開發者ID:koanreview,項目名稱:laravel-5.1-enterprise-starter-kit,代碼行數:15,代碼來源:UsersController.php

示例5: index

 /**
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $users = $this->user->pushCriteria(new UsersWithRoles())->paginate(10);
     return view('users.index', compact('users'));
 }
開發者ID:ampodobas,項目名稱:uci-law-sba-outline-bank,代碼行數:8,代碼來源:UsersController.php


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