Larabros\Elogram\Repositories\UsersRepository::find PHP Method

find() public method

Searches for and returns a single user's information. If no results are found, null is returned.
public find ( string $username ) : Response | null
$username string A username to search for
return Larabros\Elogram\Http\Response | null
    public function find($username)
    {
        $response = $this->search($username);
        foreach ($response->get() as $user) {
            if ($username === $user['username']) {
                return $this->get($user['id']);
            }
        }
        return null;
    }