/** * Get the email of a user for use in sending emails * @param string $username * @return string */ private function getEmail($username) { return User::where('username', $username)->first()->email; }
/** * Get id of the user * @param string $username * @return mixed null | integer */ private function getId($username) { $result = User::where('username', $username)->first(); return is_null($result) ? null : $result->id; }