masmerise / kbo-public-search-for-laravel
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
Requires
- php: ~8.6
- illuminate/contracts: ^13.0
- illuminate/support: ^13.0
- masmerise/kbo-public-search-php-sdk: ^2.0
- webmozart/assert: ^2.0
Requires (Dev)
- larastan/larastan: ^3.15.0
- laravel/pint: ^1.32.3
- orchestra/testbench: ^11.3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-29 13:21:33 UTC
README
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.