PHPackages                             ridwans2/filamod - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ridwans2/filamod

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ridwans2/filamod
================

Organize your Filament Code into modules using nwidart/laravel-modules

2.1(1mo ago)031MITPHPPHP ^8.3

Since Mar 15Pushed 1mo agoCompare

[ Source](https://github.com/ridwans2/filamod)[ Packagist](https://packagist.org/packages/ridwans2/filamod)[ Docs](https://github.com/ridwans2/filamod)[ GitHub Sponsors](https://github.com/ridwans2)[ RSS](/packages/ridwans2-filamod/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (8)Used By (0)

ridwans2/filamod : 2.1
======================

[](#ridwans2filamod---21)

This package brings the power of modules to Laravel Filament. It allows you to organize your filament code into fully autonomous modules that can be easily shared and reused across multiple projects. With this package, you can turn each of your modules into a fully functional Filament Plugin with its own resources, pages, widgets, components and more. What's more, you don't even need to register each of these plugins in your main Filament Panel. All you need to do is register the `ModulesPlugin` in your panel, and it will take care of the rest for you.

This package is simple a wrapper of [nwidart/laravel-modules](https://docs.laravelmodules.com) package to make it work with Laravel Filament.

Features
--------

[](#features)

- A command to prepare your module for Filament
- A command to create a Filament Cluster in your module
- A command to create additional Filament Plugins in your module
- A command to create a new Filament resource in your module
- A command to create a new Filament page in your module
- A command to create a new Filament widget in your module
- Organize your admin panel into Cluster, one for each supported module.

Requirements
------------

[](#requirements)

The following is a table showing a matrix of supported filament and laravel versions for each version of this package:

Package VersionLaravel VersionFilament Versionnwidart/laravel-modules Version2.113.x5.x13v5.x of this package requires the following dependencies:

- Laravel 13
- Filament 5
- PHP 8.3
- nwidart/laravel-modules 13

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ridwans2/filamod
```

This will automatically install `nwidart/laravel-modules: ^13` (for Laravel 11) or `nwidart/laravel-modules: ^13` (for Laravel 12) as well. Make sure you go through the [documentation](https://laravelmodules.com/docs/123) to understand how to use the package and to configure it properly before proceeding.

**Task: Configure your Laravel Modules first before continuing.**

### Autoloading modules

[](#autoloading-modules)

Don't forget to autoload modules by adding the merge-plugin to your composer.json according to the [laravel modules documentation](https://laravelmodules.com/docs/13/getting-started/installation-and-setup#autoloading):

```
"extra": {
    "laravel": {
        "dont-discover": []
    },
    "merge-plugin": {
        "include": [
            "Modules/*/composer.json"
        ]
    }
},
```

Next, Run the installation command and follow the prompts to publish the config file and set up the package:

```
php artisan modules:install
```

Alternatively, you can just publish the config file with:

```
php artisan vendor:publish --tag="modules-config"
```

### Configuration

[](#configuration)

After publishing the config file, you can configure the package to your liking. The configuration file is located at `config/filament-modules.php`.

The following can be adjusted in the configuration file:

- **mode**: The mode used by the package to discover and register resources from modules. This can be set to plugins, panels or both (default). See the ConfigMode enum for details.
- **auto-register-plugins**: If set to true, the package will automatically register all the plugins in your modules. Otherwise, you will need to register each plugin manually in your Filament Panel.
- **clusters.enabled**: If set to true, a cluster will be created in each module during the `module:filament:install`command and all filament files for that module may reside inside that cluster. Otherwise, filament files will reside in Filament/Resources, Filament/Pages, Filament/Widgets, etc.
- **clusters.use-top-navigation**: If set to true, the top navigation will be used to navigate between clusters while the actual links will be loaded as a side sub-navigation. In my opinion, this improves UX. Otherwise, the package will honor the configuration that you have in your panel.
- **panels.group**: The group under which the panels will be registered in the Main Panel's navigation. This is only applicable if the mode is set to support panels. All links to the various module panels will be grouped under this group in the main panel's navigation for ease of navigation.
- **panels.group-icon**: The group icon used in the above navigation. This is only applicable if the mode is set to support panels.
- **panels.open-in-new-tab**: If set to true, the links to the module panels will open in a new tab. This is only applicable if the mode is set to support panels.
- **panels.group-sort**: The sort order applied on each navigation item in the modules panel group.

Usage
-----

[](#usage)

### Register the plugin

[](#register-the-plugin)

The package comes with a `ModulesPlugin` that you can register in your Filament Panel. This plugin will automatically load all the modules in your application and register them as Filament plugins if the mode supports plugins (either PLUGINS or BOTH). If the configuration mode supports panels, the module is also responsible for automatically creating navigation links between the main panel and each of the module panels. In order to achieve this, you need to register the `ModulesPlugin` in your panel of choice (e.g. Admin Panel) like so:

```
// e.g. in App\Providers\Filament\AdminPanelProvider.php

use Ridwans2\Filamod\ModulesPlugin;
public function panel(Panel $panel): Panel
{
    return $panel
        ...
        ->plugin(ModulesPlugin::make());
}
```

That's it! now you are ready to start creating some filament code in your module of choice!

### Installing Filament in a module

[](#installing-filament-in-a-module)

If you don't have a module already, you can generate one using the `module:make` command like so:

```
php artisan module:make MyModule
```

Next, run the `module:filament:install` command to generate the necessary Filament files and directories in your module:

```
php artisan module:filament:install MyModule
```

This will guide you interactively on whether you want to organize your code in clusters, and whether you would like to create a default cluster. At the end of this installation, you will have the following structure in your module:

- Modules
    - MyModule
        - app
            - Filament
                - Clusters
                    - MyModule
                        - Pages
                        - Resources
                        - Widgets
                    - **MyModule.php**
                - Pages
                - Resources
                - Widgets
                - OneModulePanel
                    - Pages
                    - Resources
                    - Widgets
                - AnotherModulePanel
                    - Pages
                    - Resources
                    - Widgets
                - **MyModulePlugin.php**
            - Providers
                - Filament
                    - OneModulePanelServiceProvider.php
                    - AnotherModulePanelServiceProvider.php
                - **MyModuleServiceProvider.php**

As you can see, there are two main files generated: The plugin class and optionally the cluster class. After generation, you are free to make any modifications to these classes as you may see fit. Optionally, Panels are also generated inside the module if supported. All these can be generated individually later using their respective commands.

The **plugin** will be loaded automatically unless the configuration is set otherwise. As a result, it will also load all its clusters automatically.

Panels will register their navigation links in the main panel's navigation if the configuration is set to support panels. In the individual panels, there will also be a link to the main panel's navigation, allowing you to navigate back to the main panel.

Your module is now ready to be used in your Filament Panel. Use the following commands during development to generate new resources, pages, widgets, plugins, panels and clusters in your module:

### Creating a new resource

[](#creating-a-new-resource)

```
php artisan module:make:filament-resource
# Aliases
php artisan module:filament:resource
php artisan module:filament:make-resource
```

Follow the interactive prompts to create a new resource in your module.

### Creating a new page

[](#creating-a-new-page)

```
php artisan module:make:filament-page
# or
php artisan module:filament:page
php artisan module:filament:make-page
```

Follow the interactive prompts to create a new page in your module.

### Creating a new widget (WIP)

[](#creating-a-new-widget-wip)

```
php artisan module:make:filament-widget
# or
php artisan module:filament:widget
php artisan module:filament:make-widget
```

Follow the interactive prompts to create a new widget in your module.

### Creating a new cluster

[](#creating-a-new-cluster)

```
php artisan module:make:filament-cluster
# or
php artisan module:filament:cluster
php artisan module:filament:make-cluster
```

Follow the interactive prompts to create a new cluster in your module.

### Creating a new plugin

[](#creating-a-new-plugin)

```
php artisan module:make:filament-plugin
# or
php artisan module:filament:plugin
php artisan module:filament:make-plugin
```

Follow the interactive prompts to create a new plugin in your module.

### Create a new Filament Theme (WIP)

[](#create-a-new-filament-theme-wip)

```
php artisan module:make:filament-theme
# or
php artisan module:filament:theme
php artisan module:filament:make-theme
```

### Create a new Filament Panel (New!!)

[](#create-a-new-filament-panel-new)

```
php artisan module:make:filament-panel
# or
php artisan module:filament:panel
php artisan module:filament:make-panel
```

Follow the interactive prompts to create a new panel in your module.

### Protecting your resources, pages and widgets (Access Control) - WIP

[](#protecting-your-resources-pages-and-widgets-access-control---wip)

```
use Ridwans2\Filamod\Resource;
```

use the above resource class instead of `use Filament/Resources/Resource;` into your resource class file to protect your resources.

```
use Ridwans2\Filamod\Page;
```

use the above page class instead of `use Filament/Pages/Page;` into your page class file to protect your pages.

```
use Ridwans2\Filamod\TableWidget;
```

use the above page class instead of `use Filament/Pages/TableWidget;` into your widget class file to protect your TableWidget.

```
use Ridwans2\Filamod\ChartWidget;
```

use the above page class instead of `use Filament/Pages/ChartWidget;` into your widget class file to protect your ChartWidget.

```
use Ridwans2\Filamod\StatsOverviewWidget;
```

use the above page class instead of `use Filament/Pages/StatsOverviewWidget;` into your widget class file to protect your StatsOverviewWidget.

```
use CanAccessTrait;
```

use the above trait directly into your resource and page class file to protect your resources and pages.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [penyair kesepian](https://github.com/ridwans2)
- [All Contributors](../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

45d ago

Major Versions

1.9.5 → 2.02026-03-25

### Community

Maintainers

![](https://www.gravatar.com/avatar/93927f84d28ebd02a8233f8f1d00c9b4a555a4c62dc6fc6b99d69bacd68dd9ff?d=identicon)[ridwans2](/maintainers/ridwans2)

---

Top Contributors

[![coolsam726](https://avatars.githubusercontent.com/u/5610289?v=4)](https://github.com/coolsam726 "coolsam726 (279 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (22 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![aisuvro](https://avatars.githubusercontent.com/u/2842856?v=4)](https://github.com/aisuvro "aisuvro (6 commits)")[![ridwans2](https://avatars.githubusercontent.com/u/54924092?v=4)](https://github.com/ridwans2 "ridwans2 (6 commits)")[![piotrczech](https://avatars.githubusercontent.com/u/48844194?v=4)](https://github.com/piotrczech "piotrczech (2 commits)")[![askippers](https://avatars.githubusercontent.com/u/994820?v=4)](https://github.com/askippers "askippers (2 commits)")[![LinusTebbe](https://avatars.githubusercontent.com/u/25035074?v=4)](https://github.com/LinusTebbe "LinusTebbe (2 commits)")[![vellea](https://avatars.githubusercontent.com/u/166348568?v=4)](https://github.com/vellea "vellea (1 commits)")[![yezzmedia](https://avatars.githubusercontent.com/u/107888802?v=4)](https://github.com/yezzmedia "yezzmedia (1 commits)")[![alissn](https://avatars.githubusercontent.com/u/26966142?v=4)](https://github.com/alissn "alissn (1 commits)")[![dedanirungu](https://avatars.githubusercontent.com/u/1658098?v=4)](https://github.com/dedanirungu "dedanirungu (1 commits)")[![husam-tariq](https://avatars.githubusercontent.com/u/16601695?v=4)](https://github.com/husam-tariq "husam-tariq (1 commits)")[![jasonencode](https://avatars.githubusercontent.com/u/2210843?v=4)](https://github.com/jasonencode "jasonencode (1 commits)")[![marco76tv](https://avatars.githubusercontent.com/u/1944941?v=4)](https://github.com/marco76tv "marco76tv (1 commits)")[![nicola-net7](https://avatars.githubusercontent.com/u/215176188?v=4)](https://github.com/nicola-net7 "nicola-net7 (1 commits)")[![Saifallak](https://avatars.githubusercontent.com/u/6053156?v=4)](https://github.com/Saifallak "Saifallak (1 commits)")

---

Tags

laravelfilamentFilamentModulesridwans2

###  Code Quality

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/ridwans2-filamod/health.svg)

```
[![Health](https://phpackages.com/badges/ridwans2-filamod/health.svg)](https://phpackages.com/packages/ridwans2-filamod)
```

###  Alternatives

[pboivin/filament-peek

Full-screen page preview modal for Filament

253319.6k12](/packages/pboivin-filament-peek)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

124139.3k2](/packages/dotswan-filament-map-picker)[savannabits/filament-modules

Organize your Filament Code into modules using nwidart/laravel-modules

2014.3k](/packages/savannabits-filament-modules)[creagia/filament-code-field

A Filamentphp input field to edit or view code data.

58289.3k3](/packages/creagia-filament-code-field)[jibaymcs/filament-tour

Bring the power of DriverJs to your Filament panels and start a tour !

12247.8k](/packages/jibaymcs-filament-tour)[aymanalhattami/filament-context-menu

context menu (right click menu) for filament

9838.0k](/packages/aymanalhattami-filament-context-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
