Search by

masmerise / kbo-public-search-for-laravel

masmerise

Laravel framework adapter for the KBO Public Search SDK.

Package info

github.com/masmerise/kbo-public-search-for-laravel

pkg:composer/masmerise/kbo-public-search-for-laravel

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

2.0.0 2026-11-29 13:20 UTC

This package is auto-updated.

Last update: 2026-11-29 13:21:33 UTC


README

KBO Public Search PHP SDK Laravel

Build Status Total Downloads Latest Stable Version License

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.