sh4dw/laracvr

Wrapper for danish CVR API

1.0.11 2018-03-06 10:06 UTC

This package is not auto-updated.

Last update: 2024-11-11 00:46:44 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

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.