flow/jsonpath
PHP JSONPath implementation for querying and extracting data with XPath-like expressions. Object-oriented, tokenized/cached parser (no eval) and works with arrays, objects, and ArrayAccess. Note: this repo is unmaintained; see SoftCreatR/JSONPath.
collect() methods (e.g., pluck(), where()) by offering a more expressive query language for nested structures.collect() methods, supports recursive queries (..), and avoids eval() (unlike some alternatives).contains() or join()). However, for pure JSONPath, this is sufficient.$this->app->singleton('jsonpath', function () {
return new \Flow\JSONPath\JSONPath();
});
JsonPath::find('$.path')) for cleaner syntax.attributes or relations (e.g., JSONPath::find('$.user.address.city') on a JSON column).WHERE JSON_EXTRACT(column, '$.path')).JsonPath::find('$.user.settings.theme')).composer.json (e.g., ^0.5.0)...) could bloat memory for large datasets.ALLOW_MAGIC flag is discouraged due to unpredictability (e.g., wildcard queries missing private properties).$[name,year]), which may limit use cases.eval()-based filtering (e.g., ?(@.price > 10 && @.stock > 0)) restricts complex logic...) necessary, or can we optimize with targeted paths?collect() + native methods sufficient for our current needs?JsonPath facade to simplify usage (e.g., JsonPath::find('$.path')).jsonpath()) for quick access.getFullAddressAttribute()).whereJsonPath() for PostgreSQL).collect() operations with JSONPath where it adds clarity.data['user']['profile']['name'] → JsonPath::find('$.user.profile.name')).dev-php-5.x branch (but expect deprecation).Collection class.Collection macros to include JSONPath methods.Cache::remember()).config/app.php.debug() method to the wrapper to log parsed tokens.collect() methods...) returning unexpected results (e.g., due to circular references).How can I help you explore Laravel packages today?