Build Modular Laravel Applications with Laravel Extension
Laravel Extension helps a Laravel application discover, install, and boot optional features. Put feature code, views, routes, translations, and migrations in an extension. When a feature needs configuration, define a form for one or more plugin instances.
Why Laravel Extension?
Organize Features by Type
Extensions have a registered type and a name. The package registers Module by default. Your application can register additional types and allow selected types to contain child extensions.
Manage the Lifecycle
Laravel Extension separates discovery from installation. The kernel discovers available classes, loads installed extensions and their dependencies, then registers and boots their declared resources.
Reuse a Feature with Different Settings
A plugin is a configured instance of an extension. For example, two instances of a Banner module can use different text and placements while sharing the same PHP class.
How the Pieces Fit Together
- Extension — a class and manifest describing an optional feature.
- Kernel — discovers, registers, and boots installed extensions.
- Plugin — stores instance fields and runs the installed feature with those settings.
- Composition — lets an extension ship declared child extensions with a shared lifecycle.
Get Started
Install Laravel Extension or explore the Showcase for example applications.