common-gateway/vrijbrp-to-zgw-bundle
Prerequisites:
common-gateway/vrijbrp-to-zgw-bundle is compatible with your ZGW (Zaken API Gateway) and VrijBRP (open-source BRP alternative) versions.Installation:
composer require common-gateway/vrijbrp-to-zgw-bundle:dev-main
php artisan console commongateway:install common-gateway/vrijbrp-to-zgw-bundle
(Note: If using Symfony, replace php artisan with php bin/console.)First Use Case:
/admin/plugins) and locate the VrijBRPToZGWBundle plugin.config/packages/common_gateway/vrijbrp_to_zgw.yaml.Data Synchronization:
# config/packages/common_gateway/vrijbrp_to_zgw.yaml
sync:
cron: "0 3 * * *" # Run daily at 3 AM
Event-Driven Integration:
zgw.zaken.created, vrijbrp.person.updated).use CommonGateway\VrijBRPToZGWBundle\Event\SyncEvent;
public function handleSyncEvent(SyncEvent $event)
{
// Custom logic for post-sync processing
}
Register the listener in EventServiceProvider:
protected $listen = [
SyncEvent::class => [
YourListener::class,
],
];
Schema Management:
config/packages/common_gateway/schemas/
# config/packages/common_gateway/schemas/zaken.yaml
attributes:
custom_field:
type: string
required: false
API Gateway Configuration:
config/packages/common_gateway/zgw.yaml:
zgw:
base_uri: "https://api.zgw.example.com"
api_key: "%env(ZGW_API_KEY)%"
Logging and Monitoring:
config/logging.php:
'channels' => [
'zgw_sync' => [
'driver' => 'single',
'path' => storage_path('logs/zgw_sync.log'),
'level' => 'debug',
],
],
Jobs > Sync Logs.Schema Conflicts:
config/packages/common_gateway/vrijbrp_to_zgw.yaml:
install_schemas: false
Then manually merge schemas using commongateway:merge-schemas.Authentication Issues:
config/packages/monolog.yaml:
handlers:
zgw_http:
type: stream
path: "%kernel.logs_dir%/zgw_http.log"
level: debug
channels: ["zgw"]
Rate Limiting:
config/packages/common_gateway/vrijbrp_to_zgw.yaml:
sync:
batch_size: 50 # Default: 100
Data Mismatches:
address vs. postal_address).$mapper = $this->container->get('common_gateway.vrijbrp_to_zgw.mapper');
$zgwData = $mapper->mapVrijBRPToZGW($vrijBRPData);
Dry Runs:
php artisan zgw:sync --dry-run
(Symfony: php bin/console zgw:sync --dry-run)Database Inspection:
zgw_sync_jobs table:
SELECT * FROM zgw_sync_jobs WHERE status = 'failed' ORDER BY created_at DESC;
Event Debugging:
public function handleSyncEvent(SyncEvent $event)
{
\Log::debug('Sync Event Data:', [
'entity' => $event->getEntity(),
'action' => $event->getAction(),
]);
}
Custom Sync Logic:
# config/services.yaml
CommonGateway\VrijBRPToZGWBundle\Sync\SyncHandler:
class: App\Sync\CustomSyncHandler
arguments:
$defaultHandler: '@common_gateway.vrijbrp_to_zgw.sync.handler'
Webhook Integration:
WebhookSyncInterface:
use CommonGateway\VrijBRPToZGWBundle\Sync\WebhookSyncInterface;
class CustomWebhookSync implements WebhookSyncInterface
{
public function handleWebhook(array $payload): void
{
// Custom logic for webhook payloads
}
}
UI Customization:
resources/views/common_gateway/vrijbrp_to_zgw/
config.html.twig to add a sync status badge.How can I help you explore Laravel packages today?