laravel-advanced-concepts

Guide Laravel teams in selecting architectural patterns for features, state, and events.

25|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/peterfox/agent-skills --skill laravel-advanced-concepts
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-advanced-concepts
Source: https://github.com/peterfox/agent-skills/tree/main/laravel-advanced-concepts
Command: npx skills add https://github.com/peterfox/agent-skills --skill laravel-advanced-concepts

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This guide offers structured guidance on applying Feature Flags, State Machines, and Event Sourcing in Laravel, helping teams decide when to use each pattern and how to implement them effectively.

Core Features & Use Cases

  • Clear decision framework for when to apply Feature Flags, State Machines, or Event Sourcing in Laravel projects.
  • Practical integration patterns and libraries: Laravel Pennant for flags, spatie/laravel-model-states for state machines, and spatie/laravel-event-sourcing or Verbs for event sourcing.
  • Guidance on combining patterns for robust domains and end-to-end workflows.

Quick Start

Describe a concrete Laravel scenario (feature rollout, workflow state, or audit trail) and outline the recommended pattern with initial setup steps.

Frequently Asked Questions about laravel-advanced-concepts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
When should I use event sourcing versus state machines in Laravel?

Use Laravel event sourcing for complete audit trails of state changes, and state machines for strictly defining allowed transitions. You can combine both patterns to build robust domains with complete traceability and controlled workflows.

How do I implement feature flags in Laravel using Pennant?

Implement Laravel feature flags by integrating Laravel Pennant to control feature rollouts. This pattern allows you to toggle functionality dynamically, ensuring safe deployments and targeted feature delivery within your application.

What is the best way to manage complex model states in Laravel?

The best way to manage complex model states is using the spatie/laravel-model-states package. It provides a structured pattern for defining state transitions, ensuring your workflow logic remains valid and maintainable across Laravel projects.

Does Laravel event sourcing work with the Verbs package?

Yes, Laravel event sourcing implementations are supported alongside the Verbs package. You can use either spatie/laravel-event-sourcing or Verps to establish event-sourced auditing and improve the correctness of your historical data tracking.

How do I combine feature flags and state machines for Laravel workflows?

Combine feature flags and state machines by using Laravel Pennant to gate new workflow states and spatie/laravel-model-states to enforce transitions. This architecture ensures end-to-end workflows remain robust during progressive feature rollouts.