dev-master
9999999-devProvides an wrapper to leychile.cl with Laravel 5.3.
MIT
The Requires
- php >=5.6.4
- guzzlehttp/guzzle ^6.2
by guillermo lobos
Provides an wrapper to leychile.cl with Laravel 5.3.
Package to facilitate the use of leychile.cl web service using Laravel, (*1)
To add this package on your Laravel project add this on your `composer.json file, (*2)
"unforgivencl/larachileanlaw": "dev-master"
To install and configure add the service provider to your config/app.php
, (*3)
Unforgivencl\LaraChileanLaw\LaraChileanLawServiceProvider::class,
If you want to use the Facade add this to your facade section on config/app.php
, (*4)
'LaraChileanLaw' => Unforgivencl\LaraChileanLaw\Facades\LaraChileanLaw::class,
For example if you want to get the latests 5 laws published you can use, (*5)
$laws = LaraChileanLaw::law()->paginate(5)->getLatestPublished()->fetch();
If you want the law that contains an text with your input you can use, (*6)
$laws = LaraChileanLaw::law()->paginate(5)->content('aborto')->getByContent()->fetch();
If you want a specific law by BCN with the latest version you can use, (*7)
$law = LaraChileanLaw::law()->number('1')->getLatestSpecific()->fetch();
All responses are converted to JSON from an XML Response, if you see any weird index or order, i'm sorry but the web service are very incosistent, (*8)
This package are under development so if you find any bug feel free to send PR or send an issue., (*9)
Provides an wrapper to leychile.cl with Laravel 5.3.
MIT