'array', 'is_active' => 'boolean', 'last_triggered_at' => 'datetime', ]; public function deliveries(): HasMany { return $this->hasMany(IhWebhookDelivery::class, 'endpoint_id'); } public function scopeForBusiness($query, int $businessId) { return $query->where('business_id', $businessId); } public function scopeActive($query) { return $query->where('is_active', true); } public function listensTo(string $eventName): bool { $events = $this->events ?? []; return in_array($eventName, $events, true) || in_array('*', $events, true); } }