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


PHP Repositories\UserRepository类代码示例

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


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

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

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

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

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

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

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

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


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