Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By tarfin-labsv9.7.3MITIn 1 marketplace
Models workflows as explicit state machines in Laravel, with guards, actions, event sourcing and parallel states. Every transition is persisted for an audit trail, and it says it stays laravel-native with Eloquent and queues.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Your business logic deserves better than nested if-statements.
EventMachine brings the power of finite state machines to Laravel, inspired by XState. Define your states, transitions, and behaviors declaratively - and let the machine handle the complexity.
// Without state machines: scattered conditionals, hidden rules, impossible to test
if ($order->status === 'pending' && $user->can('approve') && !$order->isExpired()) {
if ($order->total > 10000 && !$order->hasSecondApproval()) {
// More nested logic...
}
}
// With EventMachine: clear states, explicit transitions, testable behaviors
MachineDefinition::define(
config: [
'initial' => 'pending',
'states' => [
'pending' => [
'on' => [
'APPROVE' => [
'target' => 'approved',
'guards' => [CanApproveGuard::class, NotExpiredGuard::class],
],
],
],
'approved' => [
'entry' => NotifyCustomerAction::class,
],
],
],
);
| Feature | Description |
|---|---|
| Event Sourced | Every transition persisted. Full audit trail. Replay history. |
| Behaviors | Guards validate, calculators compute, actions execute. |
| Parallel Dispatch | True parallel execution via Laravel queues. 5s + 2s = 5s, not 7s. |
| Testable | Fake any behavior. Assert states. Verify transitions. |
| Type-Safe Context | Spatie Data powered. Validated. IDE autocompletion. |
| Archival | Compress millions of events. Restore any machine instantly. |
| Laravel Native | Eloquent, DI, Artisan commands. Built for Laravel. |
composer require tarfin-labs/event-machine
php artisan vendor:publish --tag="event-machine-migrations"
php artisan migrate
EventMachine ships with an official Agent Skill so AI coding agents can write correct, idiomatic EventMachine code — it loads naming conventions, best practices, testing patterns, and the full VitePress documentation on demand.
Install via npx skills — works with 45+ agents including Claude Code, Cursor, GitHub Copilot, Cline, Codex, OpenCode, Gemini CLI, Warp, Amp, and many others:
npx skills add tarfin-labs/event-machine#plugin-dist
The CLI detects your installed agents and wires the skill into the right location. The plugin-dist branch is a self-contained, materialized snapshot published automatically on every release tag.
What the skill loads:
references/ and the full 87-page documentation under docs/.Read the full skill guide at eventmachine.dev/getting-started/agent-skill.
Only the latest major version (currently v7) receives bug fixes and security patches. All previous versions are end of life. See the Upgrading Guide for step-by-step migration from any version.
class Order extends Model
{
use HasMachines;
protected $casts = [
'machine' => MachineCast::class.':'.OrderMachine::class,
];
}
// Use it naturally
$order = Order::create();
$order->machine->send(['type' => 'SUBMIT']);
$order->machine->send(['type' => 'APPROVE']);
$order->machine->state->matches('approved'); // true
$order->machine->state->history->count(); // 3 events tracked
7-day copy clicks
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills: Invalid input
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Plugins from other owners that cover similar ground