public function exists($value, $attribute = 'name'): bool
    {
        $libraries = $this->getAll();

        foreach ($libraries as $lib) {
            if (isset($lib->{$attribute}) && $lib->{$attribute} === $value) {
                return true;
            }
        }

        return false;
    }
public function exists($value, $attribute = 'name'): bool
    {
        $libraries = $this->getAll();

        foreach ($libraries as $lib) {
            if (isset($lib->{$attribute}) && $lib->{$attribute} === $value) {
                return true;
            }
        }

        return false;
    }
public function exists ( $ value , $ attribute = 'name' ) : bool { $ libraries = $ this -> getAll ( ) ; foreach ( $ libraries as $ lib ) { if ( isset ( $ lib -> { $ attribute } ) && $ lib -> { $ attribute } === $ value ) { return true ; } } return false ; }
Check if library with certain attribute value exists

@param string $value     Library name
@param string $attribute Attribute name of library

@return bool
@throws \Exception
@throws \GuzzleHttp\Exception\GuzzleException
Check if library with certain attribute value exists