Looking to hire Laravel developers? Try LaraJobs

kbo-public-search-for-laravel maintained by masmerise

Description
Laravel framework adapter for the KBO Public Search SDK.
Author
Muhammed Sarı
Last update
2026/11/27 08:46 (dev-master)
License
Downloads
3

Comments
comments powered by Disqus

Laravel adapter for the KBO Public Search SDK

This package provides convenient access to the KBO Public Search SDK using the Laravel framework.

Installation

You can install the package via composer:

composer require masmerise/kbo-public-search-for-laravel

After that, define your kbo credentials inside the config/services.php configuration file:

'kbo' => [
    'username' => env('KBO_USERNAME'),
    'password' => env('KBO_PASSWORD'),
    'env' => env('KBO_ENV', 'production'), // or 'test'
],

Set env to test to send requests to the KBO acceptance environment instead of production. Each environment has its own credentials.

Usage

use KboPublicSearch\Core\Type\Primitive\EnterpriseNumber;

$enterprise = kbo()->enterprises->find(EnterpriseNumber::fromString('0314.595.348'))->enterprise;
$kbo = app('kbo');

$codes = $kbo->codeLists->authorizationSearchCodes()->authorizationSearchCodes;
use KboPublicSearch\Core\Type\Primitive\EnterpriseNumber;
use KboPublicSearch\KboPublicSearch;

final readonly class EnterpriseController
{
    public function __construct(private KboPublicSearch $kbo) {}

    public function show(string $number): View
    {
        $number = EnterpriseNumber::fromString($number);

        return view('enterprise.show', [
            'enterprise' => $this->kbo->enterprises->find($number)->enterprise,
        ]);
    }
}

Localization

Descriptions follow the application locale: fr returns French descriptions, any other locale returns Dutch, since KBO only serves those two. Changing the locale at runtime (App::setLocale()) updates the resolved instance as well.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email support@masmerise.be instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.