user->query()->with($with)->get(); } /** * @param string $uuid * @param array $with * @return User */ public function byUuid(string $uuid, array $with = []): User { return $this->user->query()->where('uuid', $uuid)->with($with)->get()->first(); } /** * @param string $username * @param array $with * @return User */ public function byUsername(string $username, array $with = []): User { return $this->user->query()->where('username', $username)->with($with)->get()->first(); } /** * @param string $email * @param array $with * @return User */ public function byEmail(string $email, array $with = []): User { return $this->user->query()->where('email_hashed', hash('sha512', $email))->with($with)->get()->first(); } /** * @param string $pid * @param array $with * @return User|null */ public function byPid(string $pid, array $with = []): User|null { return $this->user->query()->where('pid', $pid)->with($with)->get()->first(); } }