PHPackages                             suitetea/modularlaravel - 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. suitetea/modularlaravel

AbandonedArchivedLibrary[Framework](/categories/framework)

suitetea/modularlaravel
=======================

Allows you to organize Laravel code modularly.

0.5.4(11y ago)526.0k1MITPHPPHP &gt;=5.4.0

Since Jun 23Pushed 11y ago13 watchersCompare

[ Source](https://github.com/SuiteTea/ModularLaravel)[ Packagist](https://packagist.org/packages/suitetea/modularlaravel)[ RSS](/packages/suitetea-modularlaravel/feed)WikiDiscussions develop Synced yesterday

READMEChangelogDependencies (5)Versions (6)Used By (0)

[![Build Status](https://camo.githubusercontent.com/fa5c678cbd33058fe9d2c7f1cfb65810b09cebf7d9e4cdee652130a5a7e24a3c/68747470733a2f2f7472617669732d63692e6f72672f53756974655465612f4d6f64756c61724c61726176656c2e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/SuiteTea/ModularLaravel)

Modular Laravel
===============

[](#modular-laravel)

The Modular Laravel allows for Laravel code to be organized in smaller sets within an application.

Install
-------

[](#install)

Via Composer

```
{
	"require": {
    	"suitetea/modularlaravel": "0.5.*"
	}
}

```

Next run an update from Composer

```
composer update

```

After installation is complete, add the service provider to the `app/config/app.php` providers array.

```
SuiteTea\ModularLaravel\ModularLaravelServiceProvider

```

Modules
-------

[](#modules)

Modules are self contained packages that can be installed via Composer or instantiated manually.

Modules follow the PSR-4 package structure and should adhere to its standards.

### Registration

[](#registration)

Modules need to register with ModularLaravel. Example registration with available configuration is below:

```
ModularLaravel::register([
	'name' => 'attachments',
	'directory' => 'app/modules/attachments',
	'requires' => [
		'uploader',
		'file_system'
	],
	'namespace' => 'Modules\Attachments',
    'autoload' => [
        'files' => [
            'routes.php'
        ],
        'classmap' => [
            'controllers'
        ]
    ]
]);

```

### Pre-Registration

[](#pre-registration)

You can pre-register a module before ModularLaravel is instantiated. This is useful when a module is installed via Composer. You can autoload a file, pre-register the module, and when Laravel is booted, the module will attempt activation.

```
use SuiteTea\ModularLaravel\Manager;

Manager::preRegister([
	'name' => 'attachments',
	'directory' => 'app/modules/attachments',
	'requires' => [
		'uploader',
		'file_system'
	],
	'namespace' => 'Modules\Attachments',
    'autoload' => [
        'files' => [
            'routes.php'
        ],
        'classmap' => [
            'controllers'
        ]
    ]
]);

```

### Config Options

[](#config-options)

- **name** (required) - The name of the module. Used for registration and dependency management.
- **directory** (required) - The root directory of the module. (If autoloading via Composer, `__DIR__` can be used as a shortcut)
- **requires** - Any modules that this module depends upon. These dependencies must be installed and activated in order for this module to be activated.
- **namespace** - You can specify a specific namespace for a module for use with class autoloaders. Specifying this option will register the directory with a class autoloader. This is helpful if the module is not installed via Composer.
- **autoload** - Similar to Composer's autoload. Only accepts 'files' and 'classmap'. `files` will include any files in this array. `classmap` will add these directories to the class autoloader.

### Events

[](#events)

ModularLaravel fires two types of events when booting.

- **modules.active** - fires when a module is activated successfully. This event appends the module name to the event name, ex: `"modules.active attachments"`.
- **modules.activation\_failed** - fires when a module cannot be activated. Similar to the `modules.active` event, this event appends the module name to the end of the event, ex: `"modules.activation_failed attachments"`.

### Views

[](#views)

A module can include a `views` directory. ModuleLaravel registers a view namespace equal to the name of the module. This is helpful when referring to a specific module's views.

Example: a view file called `upload.blade.php` would be referrenced like so - `View::make('attachments::upload');

### Config Files

[](#config-files)

A module may include configuration files within a `config` directory within the module directory. ModularLaravel registers a config namespace equal to the name of the module all lowercase.

Example: a config file located at `config/config.php` in the module directory would be accessible via `Config::('modulename::configitem')`. Likewise, a config file not using the default name of `config.php` can be accessed via dot notation: `Config::('modulename::file.option')`

===

**Todo:**

- Create a configuration array that dictates which modules to activate. This can be manually coded or dynamic through a database.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.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 ~47 days

Total

4

Last Release

4199d ago

PHP version history (2 changes)0.1.1PHP &gt;=5.3.0

0.3.1PHP &gt;=5.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/ca2a06591a8c5730d66cd7dd66e4e2e797b8f1e7acaf82e13a837fc80ba02463?d=identicon)[stevenwadejr](/maintainers/stevenwadejr)

![](https://avatars.githubusercontent.com/u/2482638?v=4)[Matthew Cuyar](/maintainers/mcuyar)[@mcuyar](https://github.com/mcuyar)

---

Top Contributors

[![stevenwadejr](https://avatars.githubusercontent.com/u/1508485?v=4)](https://github.com/stevenwadejr "stevenwadejr (31 commits)")[![mcuyar](https://avatars.githubusercontent.com/u/2482638?v=4)](https://github.com/mcuyar "mcuyar (3 commits)")[![rhynodesigns](https://avatars.githubusercontent.com/u/2198266?v=4)](https://github.com/rhynodesigns "rhynodesigns (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/suitetea-modularlaravel/health.svg)

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

###  Alternatives

[laravel/pulse

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

1.7k12.1M99](/packages/laravel-pulse)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[laravel/lumen-framework

The Laravel Lumen Framework.

1.5k26.2M709](/packages/laravel-lumen-framework)[lukepolo/laracart

A simple cart for Laravel

583135.4k1](/packages/lukepolo-laracart)[themosis/framework

The Themosis framework.

676307.9k18](/packages/themosis-framework)[laravel-notification-channels/apn

Apple APN Push Notification Channel

2021.9M4](/packages/laravel-notification-channels-apn)

PHPackages © 2026

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