/**
  * Retrieve a user by the given credentials.
  *
  * @param  array $credentials
  * @return \Illuminate\Auth\Authenticatable|null
  */
 public function retrieveByCredentials(array $credentials)
 {
     if (!isset($credentials['email'])) {
         return null;
     }
     $email = $credentials['email'];
     return $this->userRepository->findUserByEmail($email);
 }
Ejemplo n.º 2
0
 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 public function create(array $data)
 {
     return $this->users->create(['name' => $data['name'], 'email' => $data['email'], 'password' => $this->hasher->make($data['password'])]);
 }