Download the PHP package dij-digital/kvk-laravel without Composer

On this page you can find all versions of the php package dij-digital/kvk-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package kvk-laravel

KVK Laravel

A Laravel package for the Dutch KVK (Kamer van Koophandel) Handelsregister API. Provides a clean, typed, and fakable interface for searching the company registry.

Requirements

Installation

The service provider and facade are auto-discovered.

Publish the config file:

Configuration

Add your API key to .env:

For testing against the KVK sandbox, use:

Usage

Search

Search the KVK registry using the fluent API:

Or pass a SearchParameters DTO directly:

Both approaches produce identical API calls.

Available search parameters

Method Type Description
kvkNumber(string) string 8-digit KVK number
rsin(string) string 9-digit RSIN number
branchNumber(string) string 12-digit branch number
name(string) string Trade name or statutory name
streetName(string) string Street name
city(string) string City name
postalCode(string) string Postal code (with houseNumber or poBoxNumber)
houseNumber(int) int House number (with postalCode)
houseLetter(string) string House letter (with houseNumber)
poBoxNumber(int) int PO box number (with postalCode)
type(array) array Filter: hoofdvestiging, nevenvestiging, rechtspersoon
includeInactiveRegistrations(bool) bool Include dissolved companies (default: false)
page(int) int Page number (default: 1)
resultsPerPage(int) int Results per page (default: 100, max: 100)

Base Profile

Retrieve detailed company information by KVK number using the fluent API:

Available base profile options

Method Description
get() Main company profile — name, registration dates, trade names, SBI activities
owner() Owner information — legal form, addresses, websites
mainBranch() Main branch details — employees, addresses, trade names, SBI activities
branches() All branches listing — counts and summary per branch
geoData(bool) Include GPS coordinates in address responses (default: false)

Branch Profile

Retrieve detailed branch information by branch number (vestigingsnummer):

Available branch profile options

Method Description
get() Branch profile — trade names, employees, addresses, websites, and SBI activities
geoData(bool) Include GPS coordinates in address responses (default: false)

Naming (Trade Names)

Retrieve trade names by KVK number:

Available naming options

Method Description
get() Trade names profile — statutory name, primary name, aliases, and branch-level names

Subscriptions (Mutatieservice)

Monitor changes to KVK registry entries via the Mutatieservice (change notifications):

Available subscription options

Method Description
get() List all subscriptions for your API key
subscription(string) Scope to a specific subscription (returns a scoped builder)

Available signal options (on scoped subscription)

Method Description
from(string) Filter signals from this ISO 8601 datetime
to(string) Filter signals until this ISO 8601 datetime
page(int) Page number (default: 1)
resultsPerPage(int) Results per page (min: 10, max: 500, default: 100)
signals() List signals for this subscription (paginated)
signal(string) Get a specific signal's full details

Error Handling

The package throws typed exceptions for API failures. All exceptions extend KvkException and expose statusCode and responseBody properties.

Exception When
KvkAuthenticationException HTTP 401 or 403 — invalid or missing API key
KvkServerException HTTP 500+ — KVK API server error
KvkRequestException Any other non-successful HTTP response

Testing

The package is designed to be easily fakeable in your application tests.

Basic Usage

Use KVK::fake() to replace all KVK API calls with a fake that returns no results:

Faking Specific Responses

Pass response DTOs to KVK::fake() using named parameters to control what each endpoint returns:

Available fake() parameters

Parameter Type Description
$baseProfile ?BaseProfileResponse Custom base profile response
$baseProfileOwner ?BaseProfileOwnerResponse Custom owner response
$baseProfileMainBranch ?BaseProfileMainBranchResponse Custom main branch response
$baseProfileBranches ?BaseProfileBranchesResult Custom branches result
$branchProfile ?BranchProfileResponse Custom branch profile response
$naming ?NamingResponse Custom naming response
$subscriptions ?SubscriptionsResult Custom subscriptions result
$signals ?SignalsResult Custom signals result
$signal ?SignalResponse Custom signal response
...$searchResponses SearchResponse Search responses — pass via withSearchResponses() on the returned FakeKVK

Fluent Builder Interface

You can also update a fake after it's been created using the fluent with* methods:

DTO Fake Defaults

Every response DTO provides a fake() method with sensible defaults from the KVK test environment. Only specify the fields you need to override:

Parameter Default
kvkNumber '69599068'
name 'Test BV Donald'
type 'hoofdvestiging'
active 'Ja'
branchNumber '000037178598'
rsin null
address null

Facade Cleanup

If you use KVK::fake() in tests that extend Laravel's TestCase, cleanup is automatic. For plain PHPUnit tests, add this to your test class:

Advanced: HTTP-Level Faking

For lower-level tests that need to verify the full HTTP pipeline (including request parameters and response parsing), you can still use Http::fake() directly:

License

MIT


All versions of kvk-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4|^8.5
illuminate/http Version ^12 || ^13
illuminate/support Version ^12 || ^13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dij-digital/kvk-laravel contains the following files

Loading the files please wait ...