lakasir / lakasir-module
No longer found in upstream repository
Requires
- php: ^8.3
- ext-zip: *
- filament/filament: ^3.2
- illuminate/process: ^11.9
- illuminate/support: ^11.9
- livewire/livewire: ^3.0
Requires (Dev)
- orchestra/testbench: ^9.4
- phpunit/phpunit: ^10.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Module runtime for Lakasir: discover, install, update and roll back modules
living in modules/, and expose each module's Filament pages, resources,
forms and views to the host panel.
Requirements
- PHP 8.3+
- Laravel 11
- Filament 3
ext-zip
Installation
composer require lakasir/lakasir-module
Publish the config (optional):
php artisan vendor:publish --tag=lakasir-module-config
Register the Filament plugin in your panel provider:
use Lakasir\LakasirModule\LakasirModulePlugin; ->plugin(LakasirModulePlugin::make())
The plugin registers the Modules page so every application can manage its modules without wiring a page of its own.
Usage
Manage modules from the panel
The Modules page lists installed modules, installs a release archive (.zip),
installs from the registry, updates to the newest registry version and rolls
back one step. Installed modules are recorded in the plugins table, per
company.
Create a module
php artisan lakasir-module:make
Scaffolds modules/<Name> from stubs/module-stubs. Generated code lives in
the module's own namespace (Modules\<Name>), so the host application stays
untouched.
Generate module classes
php artisan lakasir-module:model php artisan lakasir-module:controller php artisan lakasir-module:migration php artisan lakasir-module:resource php artisan lakasir-module:resource-relation-manager
Run module migrations
php artisan lakasir-module:migrate {module?} [--rollback] [--refresh]
Runs the module's migrations through its own ledger, so a module's migrations are tracked separately from the host application's.
Navigation
Panels that build navigation by hand can merge installed module groups:
use Lakasir\LakasirModule\Navigation\ModuleNavigation; ->groups([ ...$this->getNavigationGroups(), ...ModuleNavigation::groups(), ])
Forms and page hooks
Modules extend host forms and pages by convention:
modules/<Name>/src/Extends/<Form>/Form.php— merged byExtendModuleFormModules\<Name>\Providers\ExtendModuleServiceProvider— config, views and translations for the moduleLakasir\LakasirModule\Abstracts\ModuleResource— resource with amodules/<module>/<resource>slugLakasir\LakasirModule\Forms\ModuleForm— base class for module forms with title, description and record
Registry
registry_url points to a JSON index (default: the
module registry). Each read is
cached for registry_cache_ttl; the page's Refresh button drops the cache.
Set registry_url to null to disable installing from the registry.
Configuration
| Key | Env | Default |
|---|---|---|
registry_url |
LAKASIR_MODULE_REGISTRY_URL |
lakasir module-registry index |
timeout |
LAKASIR_MODULE_REGISTRY_TIMEOUT |
15 |
registry_cache_ttl |
LAKASIR_MODULE_REGISTRY_CACHE_TTL |
3600 |
max_upload_kb |
LAKASIR_MODULE_MAX_UPLOAD_KB |
32768 |
composer_binary |
LAKASIR_MODULE_COMPOSER_BINARY |
auto-detected |
composer_timeout |
LAKASIR_MODULE_COMPOSER_TIMEOUT |
300 |
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email lakasirapp@gmail.com instead of using the issue tracker.
Credits
License
The GNU GPLv3. Please see License File for more information.