laraxot/panel-modules is a Laravel package for support for nwidart/laravel-modules in filamentphp.
It currently has 0 GitHub stars and 2 downloads on Packagist.
Install it with composer require laraxot/panel-modules.
Discover more Laravel packages by laraxot
or browse all Laravel packages to compare alternatives.
Last updated
Modules is a FilamentPHP Plugin to enable easy integration with nwidart/laravel-modules
NB: These docs are for v3, which only supports Filament 3. If you are using Filament v2, see the documentation here to get started.
For example, if you have two modules (Blog and Pos), you should be able to have filament installed in each module with separate resources as below:
http://yoururl/blog/adminhttp://yoururl/pos/adminhttp://yoururl/pos/admin2 or whichever path you configure for that context.Each of the above directories should have their own distinct Pages, Resources and Widgets. Each of them also has a config under the module's Config folder allowing you to customize a number of parameters per context, e.g the path.
Additionally, each of these can have its own customized login page which redirects back to the module.
You can read more about Multiple Context for Filament Here.
If this is your goal, then you are in the right place.
Before you proceed, this guide assumes that you have configured your app fully to work with Laravel Modules. If you haven't, follow the Laravel Modules Docs before proceeding.
Requirements:
For example, if you have two modules (Blog and Pos), you should be able to have filament installed in each module with separate resources as below:
http://yoururl/blog/adminhttp://yoururl/pos/adminhttp://yoururl/pos/admin2 or whichever path you configure for that context.Each of the above directories should have their own distinct Pages, Resources and Widgets. Each of them also has a config under the module's Config folder allowing you to customize a number of parameters per context, e.g the path.
Additionally, each of these can have its own customized login page which redirects back to the module.
You can read more about Multiple Context for Filament Here.
If this is your goal, then you are in the right place.
Before you proceed, this guide assumes that you have configured your app fully to work with Laravel Modules. If you haven't, follow the Laravel Modules Docs before proceeding.
composer require laraxot/panel-modules
In this guide we are going to use the Blog module as an example
If the module that you want to work on does not exist, create it using nwidart/laravel-modules
php artisan module:make Blog # Create the blog module
php artisan module:make-filament-panel admin Blog # php artisan module:make-filament-panel [id] [module]
If none of the two arguments are passed, the command will ask for each of them interactively.
In this example, if the Panel id passed is admin and the module is blog, the command will generate a panel with
id blog::admin. This ID should be used in the next step when generating resources, pages and widgets.
From here on, use filament as you would normally to generate resources, Pages and Widgets. Be sure to specify the --panel option as the ID generated earlier.
If the --panel option is not passed, the command will ask for it interactively.
# For each of these commands, the package will ask for the Model and Panel.
php artisan make:filament-resource
php artisan make:filament-page
php artisan make:filament-widget
# The Model and Panel arguments are passed inline
php artisan make:filament-resource Author blog::admin
php artisan make:filament-page Library blog::admin
php artisan make:filament-widget BookStats blog::admin
All Done! For each of the panels generated, you can navigate to your module-path/panel-path e.g blog/admin to acess your panel and links to resources and pages.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.