PHPackages                             victormgomes/laravel-modules-plus - 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. victormgomes/laravel-modules-plus

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

victormgomes/laravel-modules-plus
=================================

Enhancements for the nWidart/laravel-modules package

1.0.0(2w ago)2107↓16.7%[1 PRs](https://github.com/VictorMGomes/laravel-modules-plus/pulls)MITPHPPHP ^8.4CI passing

Since Dec 16Pushed 2w agoCompare

[ Source](https://github.com/VictorMGomes/laravel-modules-plus)[ Packagist](https://packagist.org/packages/victormgomes/laravel-modules-plus)[ Docs](https://github.com/victormgomes/laravel-modules-plus)[ GitHub Sponsors](https://github.com/sponsors/VictorMGomes)[ RSS](/packages/victormgomes-laravel-modules-plus/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (23)Versions (12)Used By (0)

Laravel Modules Plus
====================

[](#laravel-modules-plus)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ade732bee62b19a794221f0a6aaf82da4b01803f271a6722fae8311afacb906f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766963746f726d676f6d65732f6c61726176656c2d6d6f64756c65732d706c75732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/laravel-modules-plus)[![GitHub Tests Action Status](https://camo.githubusercontent.com/37e0f2e7b2ed3ef62d8e5038b91386b30cfe87c954bd69e36471643957c12361/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f6c61726176656c2d6d6f64756c65732d706c75732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/victormgomes/laravel-modules-plus/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/0e9b64fc61f0c55022e5064d7be9bcb86f4061d280d746f22641dec8839ed699/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f766963746f726d676f6d65732f6c61726176656c2d6d6f64756c65732d706c75732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/victormgomes/laravel-modules-plus/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/b495b728eed7d83238fe90aa987c911681f84d5bb77f36d5b36f82f7874afae7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766963746f726d676f6d65732f6c61726176656c2d6d6f64756c65732d706c75732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/laravel-modules-plus)[![License](https://camo.githubusercontent.com/9dda3f9d7c2824668ee06a05824a08d45492b97402eb44085a0a51c1bd53841c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f766963746f726d676f6d65732f6c61726176656c2d6d6f64756c65732d706c75732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/victormgomes/laravel-modules-plus)

**The Plug-and-Play Engine for Laravel Modules.**

---

Introduction
------------

[](#introduction)

**Laravel Modules Plus** is a zero-configuration enhancement designed to transform your modules into truly self-contained, autonomous units. By extending the provided `AbstractModuleServiceProvider`, your modules instantly become **Plug-and-Play**: they automatically handle their own resource registration, factory resolution, and data seeding without any manual boilerplate in the main application.

### Why use this package?

[](#why-use-this-package)

- **Module Autonomy**: Modules become self-configuring "mini-packages". Drop a module into any project, and its logic is instantly alive.
- **Standardized Structure**: Enforces a clean, consistent convention across all modules, making your codebase predictable and enterprise-ready.
- **Zero-Config Discovery**: Automatic registration of Routes, Policies, Observers, and Events based on simple folder conventions.
- **Agnostic Factory Resolution**: Automatically resolves Eloquent factories for modular models. Keep your models clean and free of package-specific traits.
- **Dynamic Seeding**: Effortlessly manage data population with helpers that discover seeders across your entire modular ecosystem.
- **Full Command Integration**: All original `nWidart/laravel-modules` commands are fully supported and aware of the Environment Control patch.
- **AI-Enhanced Development**: Includes a built-in **Laravel Boost Skill** to help AI agents build and maintain your modules correctly.
- **Contextual Flexibility**: Optionally separate resources (Migrations, Seeders) into specific contexts like `Tenant` or `Central` for complex architectures.

---

Support us
----------

[](#support-us)

We invest a lot of resources into creating [best in class open source packages](https://github.com/victormgomes). You can support us by [sponsoring us on GitHub](https://github.com/sponsors/VictorMGomes).

---

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

[](#installation)

1. Install the package via composer:

```
composer require victormgomes/laravel-modules-plus
```

2. (Optional) Publish the configuration and stubs:

```
php artisan modules-plus:install
```

3. Update your `config/modules.php` to use the new Activator:

```
'activator' => 'env',
'activators' => [
    'env' => [
        'class' => \Victormgomes\ModulesPlus\Activators\EnvActivator::class,
    ],
],
```

---

Usage
-----

[](#usage)

### 1. Activating Modules

[](#1-activating-modules)

Manage module activation directly via your `.env` file, keeping your `modules_statuses.json` out of version control:

```
APP_MODULES_ENABLED=Auth,User,Chat,Billing
```

All standard commands (e.g., `php artisan module:list`, `module:migrate`) will respect this setting automatically. Commands like `php artisan module:enable {name}` will now update your `.env` file directly.

### 2. Standard Plug-and-Play Structure

[](#2-standard-plug-and-play-structure)

By extending `AbstractModuleServiceProvider`, the following resources are discovered and registered automatically (respecting any custom paths defined in your `modules.php` configuration):

- **Routes**: `routes/api.php` and `routes/web.php` are loaded with standard middleware.
- **Config**: Automatically merges `{module}/config/{module}.php` into the global configuration.
- **Views**: Loads views from `resources/views/` using the `{module}::` namespace.
- **Translations**: Loads lang files from `resources/lang/` (including JSON).
- **Migrations**: All migrations in `database/migrations/` are loaded by default.
- **Factories**: Factories in `database/factories/` are automatically resolved for modular models.
- **Seeders**: All seeders in `database/seeders/` can be dynamically retrieved for seeding.
- **Policies**: `app/Policies/UserPolicy.php` is automatically linked to `app/Models/User.php`.
- **Observers**: `app/Observers/UserObserver.php` is automatically linked to `app/Models/User.php`.
- **Events/Listeners**: Automatically discovers listeners in the `app/Listeners/` directory.
- **Console Commands**: Automatically registers all commands in `app/Console/Commands/`.
- **View Components**: Registers components in `app/View/Components/`.
- **Livewire**: Automatically registers components in the `Livewire/` directory.

### 3. Contextual Discovery (Advanced)

[](#3-contextual-discovery-advanced)

For more complex architectures (like Multi-Tenancy), the package allows you to silo resources into sub-contexts:

- **Contextual Migrations**: Place migrations in `database/migrations/Tenant` to load them only in specific database contexts.
- **Contextual Seeders**: Use subfolders like `database/seeders/Tenant/` and retrieve them using the `SeederPaths` helper:

```
use Victormgomes\ModulesPlus\Support\SeederPaths;
use Victormgomes\ModulesPlus\Support\TenantSeeders;

// Get seeders for any custom context
$seeders = SeederPaths::get('MyContext');

// Or use the built-in Tenant helper
$seeders = TenantSeeders::getSeeders();

$this->call($seeders);
```

---

AI Agent Integration (Laravel Boost)
------------------------------------

[](#ai-agent-integration-laravel-boost)

This package includes a dedicated **Laravel Boost Skill**. When installed, it helps AI agents (like Gemini CLI, Cursor, or Claude) understand the modular architecture, respect folder conventions, and generate correct plug-and-play code.

To install the skill in your project:

```
php artisan boost:install
```

Then select **`victormgomes/laravel-modules-plus`** from the third-party skills list.

---

Configuration
-------------

[](#configuration)

After publishing the configuration via `php artisan modules-plus:install`, you can customize the following in `config/modules-plus.php`:

- **`custom_stubs`**: When enabled, the package uses internal optimized stubs that follow the `AbstractModuleServiceProvider` pattern.
- **`paths`**: Define additional folder conventions for resource discovery that are not present in the default `nWidart/laravel-modules` configuration.

---

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

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

Credits
-------

[](#credits)

- [Victor M. Gomes](https://github.com/VictorMGomes)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance97

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~17 days

Recently: every ~7 days

Total

10

Last Release

15d ago

Major Versions

0.0.9 → 1.0.02026-05-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20375480?v=4)[Victor M. Gomes](/maintainers/victormgomes)[@VictorMGomes](https://github.com/VictorMGomes)

---

Top Contributors

[![VictorMGomes](https://avatars.githubusercontent.com/u/20375480?v=4)](https://github.com/VictorMGomes "VictorMGomes (27 commits)")

---

Tags

laravelVictor M. Gomesmodules-plus

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/victormgomes-laravel-modules-plus/health.svg)

```
[![Health](https://phpackages.com/badges/victormgomes-laravel-modules-plus/health.svg)](https://phpackages.com/packages/victormgomes-laravel-modules-plus)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9732.3M121](/packages/roots-acorn)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M120](/packages/laravel-pulse)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45344.0k1](/packages/pressbooks-pressbooks)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)

PHPackages © 2026

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