sh4dw / laracvr
Wrapper for danish CVR API
1.0.11
2018-03-06 10:06 UTC
Requires
- php: ~5.6|~7.0
- illuminate/support: ~5.1
Requires (Dev)
- phpunit/phpunit: >=5.4.3
- squizlabs/php_codesniffer: ^2.3
README
A simple Laravel CVR wrapper for the danish CVR API.
Install
Via Composer
$ composer require sh4dw/laracvr
Config
Add the following to your .env file CVR_USER=<CVR USERNAME> CVR_PASSWORD=<CVR PASSWORD>
Usage
Lookup a CVR with the following example (query could be any valid Elasticseach format).
Read more: Virk CVR documentation
use Sh4dw\Laracvr\CVRClient; $query = [ 'term' => [ 'cvrNummer' => <A VALID CVR> ] ]; $response = CVRClient::request($query); return $response;
Response format:
{ 'millis': 2, // Execution time in millis 'timedOut': false, // If timed out at the API endpoint 'totalHits': 1, //Number of hits found (results) 'data': [] //array containing all data for the CVR record }
Change log
Please see CHANGELOG for more information on what has changed recently.
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email lh@purebyte.dk instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.