Type-safe extension points for Laravel

A production-ready plugin system for Laravel applications. Build extensible apps with circuit breakers, pipelines, and async processing.

Built for production

Everything you need for extensible, resilient Laravel applications

Extension Points
Type-safe hooks with IDE support. Define extension points and let handlers react.
Circuit Breaker
Automatic fault tolerance. Failing handlers are temporarily disabled to protect your app.
Pipelines
Chain handlers together with data transformation between stages.
Async Support
Queue handlers for background processing with retries and batch support.
PHP 8 Attributes
Declarative handler registration with auto-discovery support.
Profiling
Track handler execution times with Debugbar and Pulse integration.

Safety & Resilience

Multiple layers of protection for production applications

Graceful Execution

Continue execution even when handlers fail. Collect errors without crashing.

Circuit Breaker

Auto-disable failing handlers. Configurable thresholds and recovery timeouts.

Mute & Silence

Temporarily disable specific handlers or all dispatching for seeding and testing.

Strict Mode

Catch missing handlers during development with strict mode exceptions.

Quick Start

Get up and running in minutes

Installation
composer require esegments/laravel-extensions
Define an extension point
class UserRegistered implements ExtensionPointContract
{
    public function __construct(
        public readonly User $user,
    ) {}
}
Register a handler
#[ExtensionHandler(UserRegistered::class, priority: 10)]
class SendWelcomeEmail
{
    public function handle(ExtensionPointContract $ext): mixed
    {
        Mail::to($ext->user)->send(new WelcomeEmail());
        return ['emailed' => true];
    }
}
Dispatch
Extensions::dispatch(new UserRegistered($user));

Ready to extend your app?

Check out the documentation to learn how to build extensible Laravel applications.