Skip to content

Event Extension Points

Events registers an event page type, Filament resources, calendar feed routes, Blaze-optimized views, Livewire components, SEO schema hooks, and Publishing Studio workspace support when the package is installed.

SurfaceCode
Install commandcapell:events-install
Page typeCapellCore::registerPageType(name: event)
Public feed routesevents.ics, events/{listingPage}/feed.ics
Render hooksRegisterEventSchemaHooks
SEO schemaSchemaTemplateRegistry::registerIfMissing(SchemaTemplateTypeEnum::Event, new EventSchemaTemplate)
Publishing StudioWorkspaceRegistry::register(Event::class)
LivewireEventCalendar via LivewireComponentEnum

Use RegisterForEventOccurrenceAction for Capell-owned RSVP flows. It locks the occurrence row, checks booking mode and status, handles waitlist placement, refreshes counts, and schedules notifications.

use Capell\Events\Actions\RegisterForEventOccurrenceAction;
use Capell\Events\Data\EventRegistrationData;
use Capell\Events\Models\EventOccurrence;
/** @var EventOccurrence $occurrence */
$registration = RegisterForEventOccurrenceAction::run(
$occurrence,
new EventRegistrationData(
name: 'Sam Editor',
quantity: 2,
payload: [
'source' => 'public_form',
],
),
);

Do not create EventRegistration rows directly from controllers or form handlers.

EventBookingProvider is the read-side contract for external booking systems. Use it when Capell should display availability or a booking URL without owning the registration.

use Capell\Events\Contracts\EventBookingProvider;
use Capell\Events\Models\EventOccurrence;
final class PartnerBookingProvider implements EventBookingProvider
{
public function isAvailable(EventOccurrence $occurrence, int $quantity): bool
{
return $occurrence->status->isPubliclyBookable() && $quantity <= 4;
}
public function bookingUrl(EventOccurrence $occurrence): ?string
{
return 'https://events.example.test/book/' . $occurrence->getKey();
}
}

Bind the provider in the package that owns the external booking integration.

EventRegistrationProvider is for packages that need to create a registration through a non-native backend.

use Capell\Events\Contracts\EventRegistrationProvider;
use Capell\Events\Data\EventRegistrationData;
use Capell\Events\Models\EventOccurrence;
use Capell\Events\Models\EventRegistration;
final class PartnerRegistrationProvider implements EventRegistrationProvider
{
public function register(EventOccurrence $occurrence, EventRegistrationData $registrationData): EventRegistration
{
return EventRegistration::query()->create([
'event_occurrence_id' => $occurrence->getKey(),
'status' => 'pending',
'name' => $registrationData->name,
'email' => $registrationData->email,
'phone' => $registrationData->phone,
'quantity' => $registrationData->quantity,
'payload' => $registrationData->payload,
'registered_at' => now(),
]);
}
}

Prefer the native action unless an external provider owns capacity, payment, or confirmation.

  • Events may integrate with SEO Suite and Publishing Studio through their public registries.
  • Other packages should not reach into EventModelRegistrar or Filament resources.
  • Keep public feed output free of admin or editor metadata.
Terminal window
vendor/bin/pest packages/events/tests --configuration=phpunit.xml