- Does softcreatr/jsonpath work with Laravel?
- Yes, it is a plain PHP package with no framework-specific hooks, so it can be used directly in Laravel controllers, services, middleware, and validation rules. It fits well for API responses, webhook payloads, config files, and decoded Eloquent JSON columns. For cleaner Laravel integration, wrap it in a small service class and bind it in the container.
- How do I install softcreatr/jsonpath in a Laravel application?
- Install it with Composer using composer require softcreatr/jsonpath and pin a version you have tested. The README shows a ^1.0 constraint, while the evaluation references a 2.1.0 release, so confirm the current constraint on Packagist before adopting it. No Laravel service provider is required.
- What PHP and Laravel versions does softcreatr/jsonpath support?
- The package requires PHP 8.5 or newer, so your Laravel version must also run on PHP 8.5. Laravel compatibility therefore depends on your Laravel release and its PHP support matrix. Check composer.json and test against your exact Laravel and PHP combination before production use.
- How is softcreatr/jsonpath different from json-path/json-path?
- softcreatr/jsonpath targets RFC 9535 and RFC 9485 semantics, uses tokenized parsing with caching, and avoids eval. json-path/json-path is more established with much larger community adoption and commonly follows the older Goessner draft. Choose based on standards compliance and PHP 8.5 requirements versus ecosystem maturity.
- Can I use softcreatr/jsonpath to query Eloquent JSON columns?
- Yes, decode or cast the JSON column to an array and run the JSONPath expression against that value. It is most useful when Laravel's whereJsonContains, whereJsonLength, and similar query helpers are not expressive enough. Avoid parsing the same expression for every row in large result sets; parse once and reuse it.
- Is softcreatr/jsonpath safe for user-supplied JSONPath expressions?
- Version 2.1.0 adds a dedicated expression parser and static type checker that reject malformed or ill-typed expressions before evaluation, and the package does not use eval. RFC 9485 I-Regexp support with PCRE resource limits also reduces regex backtracking risk. Still validate and constrain any user-influenced paths, and do not treat it as a complete sandbox without testing your limits.
- Does softcreatr/jsonpath support RFC 9535 functions like length(), count(), and match()?
- Yes, the 2.1.0 release adds RFC 9535 length(), count(), match(), search(), and value() extensions. It also adds RFC 9485 I-Regexp support with PCRE resource limits. These features let you express validation and shaping logic declaratively instead of writing custom PHP.
- How should I cache compiled JSONPath expressions in Laravel?
- The package already uses tokenized parsing with internal caching, but you should still avoid parsing the same expression on every request. Wrap it in a singleton service and cache parsed expressions, or cache final results where appropriate, using Laravel's cache. The 2.1.0 parser makes parse-time cost explicit, so measure before optimizing.
- Does softcreatr/jsonpath have tests and CI?
- The README advertises a GitHub Actions build badge, Codecov coverage, and phpunit, phpstan, and cs commands, so a test pipeline appears to exist. The technical evaluation notes that release notes do not document test coverage in detail. Review the CI results and coverage before relying on it in production.
- What are the license and maintenance concerns with softcreatr/jsonpath?
- The README displays an MIT license badge and links a LICENSE file, but the evaluation flags NOASSERTION metadata, so confirm the license on Packagist and GitHub before commercial use. Adoption is relatively low at around 164 stars, and the evaluation flags an unverified future release date of 2026-01-23. The 2.1.0 security hardening suggests active maintenance, but pin versions and compare against more established alternatives.