当前位置: 首页>>代码示例>>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;未经允许,请勿转载。