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


PHP Auth\Authenticatable类代码示例

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


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

示例1: subscribed

 /**
  * Determine if the given user is subscribed to the given plan.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  string  $subscription
  * @param  string  $plan
  * @param  bool  $defaultSubscription
  * @return bool
  */
 protected function subscribed($user, $subscription, $plan, $defaultSubscription)
 {
     if (!$user) {
         return false;
     }
     return $defaultSubscription && $user->onGenericTrial() || $user->subscribed($subscription, $plan);
 }
开发者ID:defenestrator,项目名称:groid,代码行数:16,代码来源:VerifyUserIsSubscribed.php

示例2: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if (!isset($credentials['password'])) {
         return false;
     }
     return $user->getAuthPassword() === $credentials['password'];
 }
开发者ID:larasite,项目名称:larasite,代码行数:14,代码来源:ConfigUserProvider.php

示例3: updateRememberToken

 /**
  * Update the "remember me" token for the given user in storage.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  string                                     $token
  * @return void
  */
 public function updateRememberToken(Authenticatable $user, $token)
 {
     if ($user->exists) {
         $user->setRememberToken($token);
         $user->save();
     }
 }
开发者ID:ssddanbrown,项目名称:bookstack,代码行数:14,代码来源:LdapUserProvider.php

示例4: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     // $is_valid = $this->model->where('Username', '=', $credentials['Username'])->where('Password', '=', $credentials['Password'])->first() != null;
     $is_valid = $user->Username == $credentials['Username'] && $this->hasher->check($credentials['Password'], $user->getAuthPassword());
     return $is_valid;
     // $plain = $credentials['password'];
     // return $this->hasher->check($plain, $user->getAuthPassword());
 }
开发者ID:ahmadmuiz,项目名称:wp_employee,代码行数:15,代码来源:CustomUserProvider.php

示例5: validateCredentials

 /**
  * @param Authenticatable $user
  * @param array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user->type == 'local') {
         $plain = $credentials['password'];
         return $this->hasher->check($plain, $user->getAuthPassword());
     }
     return true;
 }
开发者ID:h3r2on,项目名称:shibboleth,代码行数:13,代码来源:ShibolethUserProvider.php

示例6: createActivity

 /**
  * Create user login activity
  *
  * @param Authenticatable $user
  * @param $event_name
  * @return bool
  */
 protected function createActivity($user, $event_name)
 {
     if (!$user) {
         return false;
     }
     Log::info('[' . strtoupper($event_name) . '] User #' . $user->id, $user->toArray());
     return true;
 }
开发者ID:aginev,项目名称:login-activity,代码行数:15,代码来源:LogHandler.php

示例7: createNewProperty

 /**
  * Store a new property
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function createNewProperty(Request $request, Authenticatable $user)
 {
     $this->validate($request, ['description' => 'required|string', 'image_url' => 'required|url']);
     $newProperty = new VacationProperty($request->all());
     $user->properties()->save($newProperty);
     $request->session()->flash('status', "Property successfully created");
     return redirect()->route('property-index');
 }
开发者ID:TwilioDevEd,项目名称:airtng-laravel,代码行数:14,代码来源:VacationPropertyController.php

示例8: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     if ($user instanceof CustomKeyAuthenticable) {
         $method = 'get' . ucfirst($user->getAuthKeyName());
     } else {
         $method = 'getEmail';
     }
     return app('hash')->check($credentials['password'], $user->getAuthPassword()) && trim(strtolower($credentials['email'])) === trim(strtolower($user->{$method}()));
 }
开发者ID:atrauzzi,项目名称:laravel-doctrine,代码行数:16,代码来源:DoctrineAuthenticator.php

示例9: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable $user
  * @param  array $credentials
  * @return bool
  */
 public function validateCredentials(Authenticatable $user, array $credentials)
 {
     try {
         $result = $this->application->authenticate($credentials['email'], $credentials['password']);
         return $result->account->getHref() == $user->getAuthIdentifier();
     } catch (\Exception $e) {
         return false;
     }
 }
开发者ID:stormpath,项目名称:stormpath-laravel-auth-driver,代码行数:16,代码来源:StormpathUserProvider.php

示例10: loadUserRelationships

 /**
  * Load the relationships for the given user.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @return \Illuminate\Contracts\Auth\Authenticatable
  */
 protected function loadUserRelationships($user)
 {
     $user->load('subscriptions');
     if (Spark::usesTeams()) {
         $user->load(['ownedTeams.subscriptions', 'teams.subscriptions']);
         $user->currentTeam();
     }
     return $user;
 }
开发者ID:defenestrator,项目名称:groid,代码行数:15,代码来源:UserRepository.php

示例11: configureTeamForNewUser

 /**
  * Attach the user to a team if an invitation exists, or create a new team.
  *
  * @param  RegisterRequest  $request
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @return void
  */
 protected function configureTeamForNewUser(RegisterRequest $request, $user)
 {
     if ($invitation = $request->invitation()) {
         Spark::interact(AddTeamMember::class, [$invitation->team, $user]);
         $invitation->delete();
     } else {
         Spark::interact(CreateTeam::class, [$user, ['name' => $request->team]]);
     }
     $user->currentTeam();
 }
开发者ID:defenestrator,项目名称:groid,代码行数:17,代码来源:Register.php

示例12: validateCredentials

 /**
  * Validate a user against the given credentials.
  *
  * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
  * @param  array  $credentials
  * @return bool
  */
 public function validateCredentials(UserContract $user, array $credentials)
 {
     $plain = $credentials['password'];
     $options = array();
     if ($user instanceof User) {
         $options['salt'] = $user->salt;
         $options['byte_size'] = strlen($user->getAuthPassword());
     }
     return $this->hasher->check($plain, $user->getAuthPassword(), $options);
 }
开发者ID:drawmyattention,项目名称:expauth,代码行数:17,代码来源:ExpressionEngineUserProvider.php

示例13: validatePassword

 protected function validatePassword(Authenticatable $user, array $credentials)
 {
     $username = $this->getUsernameFromCredentials($credentials);
     try {
         $user->logIn($username, $credentials['password']);
     } catch (ParseException $e) {
         return false;
     }
     return true;
 }
开发者ID:parziphal,项目名称:parse,代码行数:10,代码来源:BaseProvider.php

示例14: requestChangePassword

 /**
  * Generate a token for password change and saves it in
  * the 'password_reminders' table with the email of the
  * user.
  *
  * @param Authenticatable $user An existent user.
  *
  * @return string Password reset token.
  */
 public function requestChangePassword(Authenticatable $user)
 {
     $email = $user->getReminderEmail();
     $token = $this->generateToken();
     $values = array('email' => $email, 'token' => $token, 'created_at' => new \DateTime());
     $table = $this->getTable();
     $this->app->make('db')->connection($user->getConnectionName())->table($table)->insert($values);
     $this->sendEmail($user, $token);
     return $token;
 }
开发者ID:joshle,项目名称:confide,代码行数:19,代码来源:EloquentPasswordService.php

示例15: isMaxLimitOfCheckout

 public function isMaxLimitOfCheckout()
 {
     $count = $this->user->checkoutHistories()->notReturned()->count();
     if ($count >= 2) {
         return false;
     }
     return true;
 }
开发者ID:RainyRuRu,项目名称:bookshelf,代码行数:8,代码来源:BookshelfService.php


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