ewk / laravel-modules
Manifest-driven Laravel module loader and lifecycle toolkit.
v0.2.1
2026-07-10 10:58 UTC
Requires
- php: >=8.3
- ext-mbstring: *
- ext-zip: *
- composer/semver: ^3.4
- laravel/framework: ^12|^13
- psr/log: ^3.0
Requires (Dev)
- driftingly/rector-laravel: ^2
- friendsofphp/php-cs-fixer: ^3.65
- inertiajs/inertia-laravel: ^3
- larastan/larastan: ^3
- mockery/mockery: ^1.2
- moonshine/moonshine: ^4.0
- orchestra/testbench: ^10|^11
- pestphp/pest: ^3.8|^4.0
- pestphp/pest-plugin-arch: ^3.1|^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.5|^12.5
- rector/rector: ^2
- tomasvotruba/type-coverage: ^2.2
Suggests
- inertiajs/inertia-laravel: Required only for loading module Routes/inertia.php files in Inertia host applications.
- moonshine/moonshine: Required only for the MoonShine admin UI (modules resource, index/form/detail pages, menu autoload). Provides the full v4 CRUD/UI/Laravel stack.
This package is auto-updated.
Last update: 2026-07-10 14:20:56 UTC
README
Manifest-driven runtime для модулей в Laravel 12/13.
ewk/laravel-modules находит модули по module.json, проверяет зависимости и
загружает enabled-модули через предсказуемый loader pipeline. Пакет также даёт
lifecycle-команды, runtime feature settings и опциональный MoonShine admin UI.
Quick Start
composer require ewk/laravel-modules php artisan vendor:publish --tag=modules-config php artisan make:module blog
Проверка production cache:
php artisan modules:optimize
Требования
| Компонент | Версия |
|---|---|
| PHP | 8.3+ |
| Laravel | 12 / 13 |
| Optional admin bridge | MoonShine 4 |
| Optional routes bridge | Inertia Laravel 3 |
Возможности
- Manifest-first: immutable metadata и feature schema отделены от mutable state.
- Dependency-aware registry: зависимости сортируются и проверяются по Composer SemVer.
- 15 runtime loaders: config, providers, migrations, routes и другие Laravel-артефакты.
- Lifecycle toolkit: scaffold, install, update, remove, enable и disable с rollback boundaries.
- Fresh feature values: scoped API читает актуальные overrides из
state.json. - Production-ready: registry cache, Octane contract и opt-in diagnostics.
Пример
Feature settings читаются через scoped repository; schema, values и write boundary описаны в Feature Toggles.
<?php declare(strict_types=1); use Ewk\LaravelModules\Contracts\FeatureRepositoryInterface; final readonly class PostController { public function __construct( private FeatureRepositoryInterface $features, ) { } public function index(): void { $commentsEnabled = $this->features->getBool('blog', 'enable_comments'); } }
Документация
| Раздел | Описание |
|---|---|
| Getting Started | Установка и первая проверка |
| Module Structure | Поддерживаемые runtime-пути |
| Manifest | Контракт module.json |
| Configuration | Конфиг и routing options |
| MoonShine | Опциональный admin-UI управления модулями |
| Architecture | Registry, cache, loaders, lifecycle |
| Loaders | Справочник лоадеров и написание своего |
| Feature Toggles | Runtime settings API |
| Logging | Opt-in диагностический слой и каталог событий |
| Octane | Octane worker contract и reload-операционка |
| Deployment | Docker-контракт деплоя и порядок кеширования |
| CLI | Реализованные Artisan-команды |
| AI Skills | Поставляемые Agent Skills и modules:ai-install |
| Contributing | Quality gates и PR rules |
License
MIT