Skip to content
Laravel Service for querying the Brreg API
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.gitignore
README.md
composer.json
composer.lock
phpunit.xml

README.md

Brreg

Library for connecting to Brreg api

Installation

Install using composer:

composer require helgesverre/brreg:dev-master

Add the service provider in config/app.php:

HelgeSverre\Brreg\BrregDataServiceProvider::class,

Usage


Route::get("/companies", function (Request $request, \HelgeSverre\Brreg\BrregService $brreg) {

    $searchTerm = $request->input("q");
    
    
    $companies = $brreg->searchByName($searchTerm);

    return new Jsonresponse($companies["data"]);
});

By default, only 10 results are returned, however this can be changed as such:

// Show 20 results, start on page 0
$companies = $brreg->searchByName("Acme", 0, 20);

// Get the 20 next entries
$companies = $brreg->searchByName("Acme", 1, 20);

You can also fetch company data by the Registration number (Org Nr):


$companyData = $brreg->getCompanyData(814114562);
You can’t perform that action at this time.