App\Services\Repositories\UserRepository::has PHP Method

has() public method

Determine if a user exists in the repository.
public has ( string $identification, string $type = 'uid' ) : boolean
$identification string
$type string Must be one of properties defined in User class
return boolean
    public function has($identification, $type = 'uid')
    {
        if ($type == "uid") {
            return Arr::has($this->items, $identification);
        } else {
            return Arr::where((array) $this->items, function ($key, $value) use($identification, $type) {
                if (property_exists($value, $type)) {
                    return false;
                }
                return $value->{$type} == $identification;
            });
        }
    }