common-gateway/first-registration-bundle
Installation via Composer
composer require common-gateway/first-registration-bundle:dev-main
common-gateway base system is installed.Run the Installation Command
php artisan commongateway:install common-gateway/first-registration-bundle
Access the Plugin via Admin UI
FirstRegistrationBundle, select it, and install it.Verify Functionality
Eerste Inschrijving (First Registration) workflow in your application’s relevant modules (e.g., user onboarding, registration forms).User entity or create a custom FirstRegistration entity to store additional data (e.g., registration_date, source, or metadata).Dependency Injection
use CommonGateway\FirstRegistrationBundle\Service\FirstRegistrationService;
public function __construct(FirstRegistrationService $firstRegistrationService) {
$this->firstRegistrationService = $firstRegistrationService;
}
Event Listeners
FirstRegistrationCreated) to trigger side effects:
// src/EventListener/FirstRegistrationListener.php
public function onFirstRegistration(FirstRegistrationEvent $event) {
// Custom logic (e.g., send welcome email, log activity)
}
config/services.php:
'listeners' => [
'first_registration.created' => [
'App\EventListener\FirstRegistrationListener',
],
],
Custom Schemas
# config/commongateway/first_registration.yaml
fields:
custom_field:
type: text
label: "Custom Field"
API/Controller Integration
Route::post('/register-first', [FirstRegistrationController::class, 'store']);
Service Provider Binding
Bind the bundle’s services in AppServiceProvider:
public function register() {
$this->app->bind(
FirstRegistrationService::class,
CommonGateway\FirstRegistrationBundle\Service\FirstRegistrationService::class
);
}
Migrations The bundle may include migrations. Run:
php artisan migrate
Configuration Publish the bundle’s config:
php artisan vendor:publish --provider="CommonGateway\FirstRegistrationBundle\FirstRegistrationBundle" --tag="config"
Namespace Conflicts
CommonGateway namespace. If your project uses similar namespaces, alias classes to avoid collisions:
use CommonGateway\FirstRegistrationBundle\Service\FirstRegistrationService as BundleFirstRegistrationService;
Missing Dependencies
common-gateway/core or equivalent is installed. The bundle relies on its base functionality.Schema Overrides
config/commongateway/first_registration.yaml must match the bundle’s expected structure. Validate against the bundle’s default schema first.Event Naming
FirstRegistrationCreated are case-sensitive. Typos will break listeners.Docker/Composer Permissions
php container has write permissions for vendor/ and config/.Check Logs
APP_DEBUG=true) and inspect storage/logs/laravel.log for bundle-related errors.Console Commands
php artisan commongateway:list
php artisan commongateway:uninstall common-gateway/first-registration-bundle
php artisan commongateway:install common-gateway/first-registration-bundle
Database Issues
plugins and first_registration tables for inconsistencies.Custom Validation
FirstRegistrationValidator class and binding it in AppServiceProvider.API Extensions
routes/web.php).Frontend Integration
resources/views/vendor/first_registration/).Testing
$this->app->instance(
FirstRegistrationService::class,
Mockery::mock(FirstRegistrationService::class)
);
Environment Variables
The bundle may rely on .env variables (e.g., COMMON_GATEWAY_FIRST_REGISTRATION_ENABLED). Set these explicitly if not auto-loaded.
Caching Clear caches after schema/config changes:
php artisan config:clear
php artisan cache:clear
Local Development
Use dev-main branch for testing. Avoid stable tags if the bundle is actively developed.
How can I help you explore Laravel packages today?