PHPackages                             savannabits/modular - 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. [Framework](/categories/framework)
4. /
5. savannabits/modular

AbandonedArchivedLibrary[Framework](/categories/framework)

savannabits/modular
===================

Organize your Laravel code into Modules

0.1.1(2y ago)05[2 PRs](https://github.com/savannabits/modular/pulls)MITPHPPHP ^8.2CI passing

Since Apr 6Pushed 9mo ago1 watchersCompare

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

READMEChangelog (5)Dependencies (13)Versions (7)Used By (0)

Organize your Laravel code into Modules
=======================================

[](#organize-your-laravel-code-into-modules)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dd039eb5763da0ba83f48a33a6d6b096d2fb603cbeb7414a3217cda65ad8aadc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736176616e6e61626974732f6d6f64756c61722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/savannabits/modular)[![GitHub Tests Action Status](https://camo.githubusercontent.com/95fa154a67ddfe9d8792ff76eb7e12aa8de22e49ec749d45af160a8c09a811e8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736176616e6e61626974732f6d6f64756c61722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/savannabits/modular/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/8e17c2df96e4c9d6af5d0323bf756a7ad8195c7de7ad813096a77bbee81c27e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f736176616e6e61626974732f6d6f64756c61722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/savannabits/modular/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/54eb0375040dc1c0df56bc5d83da4e336b577fcc598d4dc42802b0f8b5252281/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f736176616e6e61626974732f6d6f64756c61722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/savannabits/modular)

This package offers you the simplest way to organize your Laravel code into modules. Each module is a separate directory that contains all the necessary files for a complete Laravel package. We have tried as much as possible to use or extend the existing laravel commands and structures to offer the same rich features that Laravel continues to ship, and make it easier to maintain the package as Laravel evolves.

Minimum Requirements
--------------------

[](#minimum-requirements)

- Laravel 11 or higher
- PHP 8.2 or higher

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

[](#installation)

You can install the package via composer:

```
composer require savannabits/modular
```

Once the package is installed, run the following command to prepare your app for generation of modules:

```
php artisan modular:install
```

Follow the prompts to complete the installation.

Usage
-----

[](#usage)

This package offers several commands which allow you to generate standard Laravel files and classes in your modules.

### Module Generation

[](#module-generation)

However, first you have to generate a module using the following command:

```
php artisan modular:make ModuleName
```

The above command will generate a directory structure similar to that of a standard laravel App, with an additional service provider to allow registration of the module. The module is generated inside the /modules directory of your project. Additionally, the command will proceed to install the module as a symlinked local package in your composer file so that it can be autoloaded. This process may also be triggered by using the command

```
php artisan modular:activate ModuleName
```

Activating a module
-------------------

[](#activating-a-module)

Run the following command to activate a module:

```
php artisan modular:activate ModuleName
```

This command will symlink the module to the composer file and run composer dump-autoload to make the module available to the application.

Deactivating a module
---------------------

[](#deactivating-a-module)

Run the following command to deactivate a module:

```
php artisan modular:deactivate ModuleName
```

This command will remove the module from the composer file and run composer dump-autoload to remove the module from the application.

### Generating a Controller

[](#generating-a-controller)

To generate a controller in a module, run the following command and follow the prompts:

```
php artisan modular:make-controller
```

### Generating a Model

[](#generating-a-model)

To generate a model in a module, run the following command and follow the prompts:

```
php artisan modular:make-model
```

### Generating a Migration

[](#generating-a-migration)

To generate a migration in a module, run the following command and follow the prompts:

```
php artisan modular:make-migration
```

### Generating a Factory

[](#generating-a-factory)

To generate a factory in a module, run the following command and follow the prompts:

```
php artisan modular:make-factory
```

### Generating a Seeder

[](#generating-a-seeder)

To generate a seeder in a module, run the following command and follow the prompts:

```
php artisan modular:make-seeder
```

### Generating a Policy

[](#generating-a-policy)

To generate a policy in a module, run the following command and follow the prompts:

```
php artisan modular:make-policy
```

### Generating a Request

[](#generating-a-request)

To generate a request in a module, run the following command and follow the prompts:

```
php artisan modular:make-request
```

### Generating a Resource

[](#generating-a-resource)

To generate a resource in a module, run the following command and follow the prompts:

```
php artisan modular:make-resource
```

### Generating a Test

[](#generating-a-test)

To generate a test in a module, run the following command and follow the prompts:

```
php artisan modular:make-test
```

### Generating a Job

[](#generating-a-job)

To generate a job in a module, run the following command and follow the prompts:

```
php artisan modular:make-job
```

### Generating a Console Command

[](#generating-a-console-command)

To generate a console command in a module, run the following command and follow the prompts:

```
php artisan modular:make-command
```

### Generating a Provider

[](#generating-a-provider)

To generate a provider in a module, run the following command and follow the prompts:

```
php artisan modular:make-provider
```

### Generating a view

[](#generating-a-view)

To generate a view in a module, run the following command and follow the prompts:

```
php artisan modular:make-view
```

Helpers
-------

[](#helpers)

The package also offers a few helper functions to make it easier to work with modules.

### Get all modules

[](#get-all-modules)

To get all modules in the application, you can use the following helper function:

```
use Savannabits\Modular\Facades\Modular;

$modules = Modular::allModules();
```

The above code will return a collection of instances of the `Savannabits\Modular\Module` class for all active modules in the app.

### Get a module

[](#get-a-module)

To get a specific module in the application, you can use the following helper function:

```
use Savannabits\Modular\Facades\Modular;

$module = Modular::module('ModuleName');
```

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.

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

[](#security-vulnerabilities)

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

Credits
-------

[](#credits)

- [Sam Maosa](https://github.com/coolsam726)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance41

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.5% 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 ~1 days

Total

4

Last Release

768d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5610289?v=4)[Sam Maosa](/maintainers/coolsam726)[@coolsam726](https://github.com/coolsam726)

---

Top Contributors

[![coolsam726](https://avatars.githubusercontent.com/u/5610289?v=4)](https://github.com/coolsam726 "coolsam726 (76 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

---

Tags

code-generatorslaravel-modulesmodularmoduleslaravelmodularsavannabits

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/savannabits-modular/health.svg)

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

###  Alternatives

[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)[lunarstorm/laravel-ddd

A Laravel toolkit for Domain Driven Design patterns

17959.0k](/packages/lunarstorm-laravel-ddd)[bezhansalleh/filament-plugin-essentials

A collection of essential traits that streamline Filament plugin development by taking care of the boilerplate, so you can focus on shipping real features faster

27584.7k16](/packages/bezhansalleh-filament-plugin-essentials)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[daniel-cintra/modular

A fast way to develop web apps using Laravel, Vue and Inertia.

1763.8k1](/packages/daniel-cintra-modular)[jonpurvis/squeaky

A Laravel Validation Rule to Help Catch Profanity.

706.0k](/packages/jonpurvis-squeaky)

PHPackages © 2026

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