• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Repositories\UserRepository类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中App\Repositories\UserRepository的典型用法代码示例。如果您正苦于以下问题:PHP UserRepository类的具体用法?PHP UserRepository怎么用?PHP UserRepository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: postRegister

 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  App\Repositories\UserRepository
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request, UserRepository $userRepository)
 {
     $this->validate($request, ['name' => 'required|max:255', 'email' => 'required|email|max:255|unique:users', 'password' => 'required|confirmed|min:6']);
     $user = $userRepository->store($request);
     Auth::login($user);
     return redirect('/');
 }
开发者ID:mime55,项目名称:lumenvue,代码行数:14,代码来源:AuthController.php


示例2: index

 /**
  * Display a list of active talents
  *
  * @param UserRepository $userRepository
  * @return $this
  */
 public function index(UserRepository $userRepository)
 {
     $talents = $userRepository->findActiveTalents(Input::get('tag'), Input::get('describes'), Input::get('location'), null, 12, Input::get('professions'));
     $describes = Skill::lists('name', 'id')->all();
     $professions = Profession::lists('name', 'id')->all();
     return view('talent.index')->with('talents', $talents)->with('describes', $describes)->with('professions', $professions);
 }
开发者ID:katzumi,项目名称:talent4startups,代码行数:13,代码来源:TalentController.php


示例3: showAccueil

 /**
  * Retourne la vue d'accueil de l'étudiant
  *
  * @return View
  */
 public function showAccueil(UserRepository $userRepository)
 {
     $recherche = $this->etudiantRepository->getRecherche($this->etudiant->id);
     $suggestions = $this->getSuggestions();
     $responsables = $userRepository->getListModerateurs($this->etudiant->promotion_id);
     return view('etudiant.home', compact('recherche', 'suggestions', 'responsables'));
 }
开发者ID:Anassdev,项目名称:AdopteUnStage,代码行数:12,代码来源:EtudiantAccueilController.php


示例4: postRegister

 public function postRegister(RegisterRequest $request, UserRepository $user_gestion)
 {
     $user = $user_gestion->storeUserRegister($request);
     $this->dispatch(new SendMail($user));
     $alertClass = "alert-success";
     $message = "ChickenElectric thông báo.Bạn đã đăng ký thành công tài khoản. Để hoàn tất bạn hãy truy cập email để kích hoạt tài khoản.";
     return redirect(route('website.index'))->with(compact('message', 'alertClass'));
 }
开发者ID:doankhoi,项目名称:Application,代码行数:8,代码来源:AuthController.php


示例5: ProviderStub

 function it_creates_a_user_if_authorization_is_granted(Factory $socialite, UserRepository $repository, Guard $guard, User $user, AuthenticateUserListener $listener)
 {
     $socialite->driver('github')->willReturn(new ProviderStub());
     $repository->findByUsernameOrCreate(ProviderStub::$data)->willReturn($user);
     //        $guard->login($user, static::HAS_CODE)->shouldBeCalled();
     //        $listener->userHasLoggedIn($user)->shouldBeCalled();
     $this->execute(self::HAS_CODE, $listener);
 }
开发者ID:sabahtalateh,项目名称:laracast,代码行数:8,代码来源:AuthenticateUserSpec.php


示例6: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(UserRepository $userRepository)
 {
     $user = $userRepository->findByUsername($this->username, ['userType']);
     $type = null;
     if ($user) {
         $type = $user->userType->type;
     }
     return $type;
 }
开发者ID:team-ccsad,项目名称:project-101,代码行数:14,代码来源:GetUserType.php


示例7: handle

 /**
  * Execute the job.
  *
  * @param UserRepository $repository
  * @return void
  */
 public function handle(UserRepository $repository)
 {
     $person = User::addHouseholdMember($this->firstname, $this->lastname, $this->middleinitial, $this->gender, $this->mobile_no, $this->email);
     $repository->save($person);
     $member = HouseholdMember::addMember($this->household_id, $person->id);
     $household = Household::findOrFail($this->household_id);
     $household->members()->save($member);
     event(new UserHasRegistered($person));
 }
开发者ID:ehomeuc,项目名称:ehome,代码行数:15,代码来源:AddNewHouseholdMemberJob.php


示例8: handle

 /**
  * Execute the job.
  *
  * @return void
  */
 public function handle(UserRepository $userRepository)
 {
     $user = $userRepository->find($this->user['id']);
     if (!Hash::check($this->params['old_password'], $user->password)) {
         throw new PasswordNotMatch();
     }
     $password = bcrypt($this->params['password']);
     return $userRepository->update($this->user['id'], ['password' => $password]);
 }
开发者ID:team-ccsad,项目名称:project-101,代码行数:14,代码来源:ChangePassword.php


示例9: getResend

 public function getResend(UserRepository $user_gestion, Request $request)
 {
     if ($request->session()->has('user_id')) {
         $user = $user_gestion->getById($request->session()->get('user_id'));
         $this->dispatch(new SendMail($user));
         return redirect('/')->with('ok', trans('front/verify.resend'));
     }
     return redirect('/');
 }
开发者ID:nguyenngochainam92,项目名称:sellShop,代码行数:9,代码来源:AuthController.php


示例10: handle

 public function handle(UserRepository $user_repo, SettingRepository $setting_repo)
 {
     $sample = $this->sample;
     $users = $user_repo->getAll();
     $settings = $setting_repo->getWithSlugKeys();
     foreach ($users as $user) {
         Mail::send('mail.notify_admin_of_new_sample', ['sample' => $sample, 'settings' => $settings], function ($m) use($sample, $user) {
             $m->to($user->email, $user->name)->subject('Anmeldung Probe ' . $sample->generated_number);
         });
     }
 }
开发者ID:manogi,项目名称:gfw-qm,代码行数:11,代码来源:NotifyAdminOfNewSample.php


示例11: handle

 /**
  * Execute the command.
  *
  * @param Hasher $hasher
  * @param UserRepository $users
  * @return User
  * @throws UserAlreadyExistsException
  */
 public function handle(Hasher $hasher, UserRepository $users)
 {
     try {
         $users->findByEmail($this->email);
         throw new UserAlreadyExistsException($this->email);
     } catch (ModelNotFoundException $e) {
         $user = User::register($this->name, $this->email, $hasher->make($this->password), 'admin');
         $users->save($user);
         event(new UserWasRegistered($user));
         return $user;
     }
 }
开发者ID:manishkiozen,项目名称:Cms,代码行数:20,代码来源:RegisterAdministratorUserCommand.php


示例12: indexOrder

 /**
  * Display a listing of the resource.
  *
  * @param  Illuminate\Http\Request $request
  * @return Response
  */
 public function indexOrder(Request $request)
 {
     $statut = $this->user_gestion->getStatut();
     $posts = $this->blog_gestion->index(10, $statut == 'admin' ? null : $request->user()->id, $request->input('name'), $request->input('sens'));
     $links = str_replace('/?', '?', $posts->render());
     return response()->json(['view' => view('back.blog.table', compact('statut', 'posts'))->render(), 'links' => $links]);
 }
开发者ID:nitsmax,项目名称:els,代码行数:13,代码来源:BlogController.php


示例13: index

 /**
  * Show all notifications
  *
  * @return string
  */
 public function index()
 {
     try {
         //Get the notifications for the currently logged in user
         $notifications = $this->userRepo->paginateNotifications($this->auth->user());
         //Get next Page url
         $nextPageUrl = generate_next_page_url($notifications);
         //This is not an ajax request
         if (!$this->input->is_ajax_request()) {
             //Load view with data
             $this->load->view('pages/notifications', compact('notifications', 'nextPageUrl'));
         } else {
             //Is an ajax request
             echo json_encode(['error' => false, 'grid' => $this->load->view('pages/partials/_notifications-grid', compact('notifications'), true), 'nextPageUrl' => $nextPageUrl]);
         }
     } catch (Exception $e) {
         //This is not an ajax request
         if (!$this->input->is_ajax_request()) {
             //Show error page
             show_404();
         } else {
             //Is an ajax request
             echo json_encode(['error' => true, 'message' => $e->getMessage()]);
         }
     }
 }
开发者ID:AshniSukhoo,项目名称:UOM_connect,代码行数:31,代码来源:NotificationsController.php


示例14: 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


示例15: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $user = $this->userRepository->find($this->authorizer->getResourceOwnerId());
     App::singleton('user', function () use($user) {
         return $user->toArray();
     });
     return $next($request);
 }
开发者ID:team-ccsad,项目名称:project-101,代码行数:15,代码来源:Authenticate.php


示例16: admin

 /**
  * Show the admin panel.
  *
  * @param  App\Repositories\ContactRepository $contact_gestion
  * @param  App\Repositories\BlogRepository $blog_gestion
  * @param  App\Repositories\CommentRepository $comment_gestion
  * @return Response
  */
 public function admin(ContactRepository $contact_gestion, BlogRepository $blog_gestion, CommentRepository $comment_gestion)
 {
     $nbrMessages = $contact_gestion->getNumber();
     $nbrUsers = $this->user_gestion->getNumber();
     $nbrPosts = $blog_gestion->getNumber();
     $nbrComments = $comment_gestion->getNumber();
     return view('back.index', compact('nbrMessages', 'nbrUsers', 'nbrPosts', 'nbrComments'));
 }
开发者ID:SaadQobaa,项目名称:testing_laravel,代码行数:16,代码来源:AdminController.php


示例17: execute

 public function execute($hasCode, $listener, $provider)
 {
     if (!$hasCode) {
         return $this->getAuthorization($provider);
     }
     $user = $this->users->findByUsernameOrCreate($this->getUser($provider));
     $this->auth->login($user, true);
     return $listener->userAuthenticated($user);
 }
开发者ID:andela-fokosun,项目名称:learner-tube,代码行数:9,代码来源:AuthenticateUser.php


示例18: execute

 public function execute($hasCode)
 {
     if (!$hasCode) {
         return $this->getAuthFirst();
     }
     $user = $this->users->findByEmailOrCreate($this->getGithubUser());
     Auth::loginUsingId($user->id, true);
     return redirect('/profile');
 }
开发者ID:steveperrito,项目名称:flora-laravel,代码行数:9,代码来源:AuthenticateUser.php


示例19: google

 /**
  * @param boolean $hasCode
  * @param AuthenticateUserListener $listener
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function google($hasCode, AuthenticateUserListener $listener)
 {
     if (!$hasCode) {
         return $this->socialite->driver('google')->redirect();
     }
     $user = $this->users->findByUsernameOrCreate($this->socialite->driver('google')->user());
     $this->auth->login($user, true);
     return $listener->userHasLoggedIn($user);
 }
开发者ID:gaurangsudra,项目名称:laravel51-multiauth-socialite,代码行数:14,代码来源:AuthenticateUser.php


示例20: execute

 /**
  * @param $request
  * @param $listener
  * @param $provider
  * @return \Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function execute($request, $listener, $provider)
 {
     if (!$request) {
         return $this->getAuthorizationFirst($provider);
     }
     $user = $this->users->findByUserNameOrCreate($this->getSocialUser($provider));
     $this->auth->login($user, true);
     return $listener->userHasLoggedIn($user);
 }
开发者ID:VasylKozyrenko,项目名称:library,代码行数:15,代码来源:AuthenticateUser.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP services\Config类代码示例发布时间:2022-05-23
下一篇:
PHP models\User类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap