Cartalyst\Sentinel\Users\UserInterface::getUserId PHP Method

getUserId() public method

Returns the user primary key.
public getUserId ( ) : integer
return integer
    public function getUserId();

Usage Example

Beispiel #1
0
 /**
  * {@inheritDoc}
  */
 public function complete(UserInterface $user, $code, $password)
 {
     $expires = $this->expires();
     $reminder = $this->createModel()->newQuery()->where('user_id', $user->getUserId())->where('code', $code)->where('completed', false)->where('created_at', '>', $expires)->first();
     if ($reminder === null) {
         return false;
     }
     $credentials = compact('password');
     $valid = $this->validateUser($credentials, $user->getUserId());
     if ($valid === false) {
         return false;
     }
     sentinel()->update($user->getUserId(), $credentials);
     $reminder->fill(['completed' => true, 'completed_at' => Carbon::now()]);
     $reminder->save();
     return true;
 }
All Usage Examples Of Cartalyst\Sentinel\Users\UserInterface::getUserId