| Package Data | |
|---|---|
| Maintainer Username: | libtek |
| Maintainer Contact: | btischler@gmail.com (Ben Tischler) |
| Package Create Date: | 2015-11-26 |
| Package Last Update: | 2015-11-27 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-22 15:14:49 |
| Package Statistics | |
|---|---|
| Total Downloads: | 1,394 |
| Monthly Downloads: | 1 |
| Daily Downloads: | 0 |
| Total Stars: | 1 |
| Total Watchers: | 2 |
| Total Forks: | 4 |
| Total Open Issues: | 0 |
A Laravel 5 wrapper for use of the jmespath.php library. The jmespath.php library is an implementation of the JMESPath specification.
This package also provides Artisan commands to pre-compile and manage your JMESPath expressions.
$ composer require libtek/laravel-jmespath
In config/app.php, add the service provider to the $providers array:
'providers' => [
// ...
Libtek\Jmes\JmesServiceProvider::class,
],
In config/app.php, add the facade to the $aliases array:
'aliases' => [
// ...
'Jmes' => Libtek\Jmes\Facades\Jmes::class,
],
If you'd like to modify the default configuration values or define expressions to pre-compile, publish the package config file:
php artisan vendor:publish --provider="Libtek\Jmes\JmesServiceProvider"
This will create a jmes.php file in your config directory.
$result = Jmes::search($expression, $data);
$result = jmes($expression, $data);
Two Artisan commands are available with the package:
jmes:compileThis compiles and caches JMESPath expressions. Expressions can be sourced in multiple ways:
Running the command with no options or arguments will look for expressions in the jmes.php config file:
php artisan jmes:compile
Passing a single expression to the command:
php artisan jmes:compile 'foo.*.baz'
Setting the -c or --cli option will prompt for expressions to be added manually:
php artisan jmes:compile --cli
Please enter a JMESPath expression:
> foo.*.baz
jmes:clearThis will delete any previously compiled expressions:
php artisan jmes:clear
Pass -h or --help to either command to view its usage.