Event System
Overview
Event Patterns
Pre-Event Pattern (Validation/Veto)
use App\Core\Event\User\Registration\UserRegistrationRequestedEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class SecuritySubscriber implements EventSubscriberInterface
{
public static function getSubscribedEvents(): array
{
return [
UserRegistrationRequestedEvent::class => 'onRegistrationRequested',
];
}
public function onRegistrationRequested(UserRegistrationRequestedEvent $event): void
{
// Block suspicious registrations
if ($this->isBlacklisted($event->getEmail())) {
$event->stopPropagation();
$event->setRejected(true, 'Email domain is blacklisted');
}
}
}Post-Event Pattern (Side Effects)
Mutable Events
Event Categories
1. User Events (18 events)
Registration Flow (10 events)
Event
Type
Description
Authentication Flow (7 events)
Event
Type
Description
Account Events (3 events)
Event
Type
Description
2. Server Events (87 events)
Server Purchase & Renewal (19 events)
Event
Type
Description
Server Management (6 events)
Event
Type
Description
Server Backups (10 events)
Event
Type
Description
Server Databases (7 events)
Event
Type
Description
Server Network/Allocations (12 events)
Event
Type
Description
Server Configuration (11 events)
Event
Type
Description
Server Schedules (15 events)
Event
Type
Description
Server Subusers (7 events)
Event
Type
Description
Server Tabs (1 event)
Event
Type
Description
Server Miscellaneous (7 events)
Event
Type
Description
3. Payment & Balance Events (16 events)
Balance Recharge (7 events)
Event
Type
Description
Payment Gateways (4 events)
Event
Type
Description
Cart (9 events)
Event
Type
Description
4. Store Events (6 events)
Event
Type
Description
5. Plugin Events (14 events)
Event
Type
Description
6. Form & View Events (4 events)
Form Events (2 events)
Event
Type
Description
View Events (1 event)
Event
Type
Description
7. Menu & Navigation Events (2 events)
Event
Type
Description
8. Email Events (2 events)
Event
Type
Description
9. CRUD/Admin Panel Events (11 events)
Configuration Events (5 events)
Event
Type
Description
Operation Events (6 events)
Event
Type
Description
10. Password Recovery Events (8 events)
Event
Type
Description
11. SSO Events (4 events)
Event
Type
Description
12. Voucher Events (9 events)
Event
Type
Description
13. Dashboard Events (2 events)
Event
Type
Description
14. Admin Overview Events (2 events)
Event
Type
Description
15. Product Events (2 events)
Event
Type
Description
16. Page Events (2 events)
Event
Type
Description
17. Security Events (1 event)
Event
Type
Description
18. Widget Events (1 event)
Event
Type
Description
19. Theme Events (20 events)
Theme Upload (4 events)
Event
Type
Description
Theme Copy (3 events)
Event
Type
Description
Theme Export (3 events)
Event
Type
Description
Theme Delete (3 events)
Event
Type
Description
Theme Default Change (3 events)
Event
Type
Description
Theme Page Access (4 events)
Event
Type
Description
20. Landing Page Events (4 events)
Event
Type
Description
21. CLI Events (23 events)
Suspend Unpaid Servers (6 events)
Event
Type
Description
Delete Inactive Servers (6 events)
Event
Type
Description
Sync Servers (7 events)
Event
Type
Description
User Management CLI (6 events)
Event
Type
Description
Event Context
Service Registration
Event Priority
Stopping Event Propagation
Best Practices
Common Use Cases
1. Welcome Bonus
2. Fraud Detection
3. External CRM Sync
4. Custom Analytics
5. Notification System
Related Guides
Last updated