PHPackages                             wilocampo/modular-php74 - 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. wilocampo/modular-php74

ActiveLibrary[Framework](/categories/framework)

wilocampo/modular-php74
=======================

Modularize your Laravel apps - PHP 7.4 compatible fork

v1.0.0(5mo ago)00MITPHPPHP &gt;=7.4

Since Nov 5Pushed 5mo agoCompare

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

READMEChangelogDependencies (7)Versions (13)Used By (0)

[![Modular](art/modular.png)](art/modular.png)

`wilocampo/modular-php74`
=========================

[](#wilocampomodular-php74)

> **Note:** This is a PHP 7.4 compatible fork of [InterNACHI/modular](https://github.com/InterNACHI/modular). The original package requires PHP &gt;= 8.0. This fork maintains the same functionality while supporting PHP 7.4 and Laravel 8.x.
>
> **Key Changes:**
>
> - Removed PHP 8.0+ syntax (constructor property promotion, union types, etc.)
> - Updated to support PHP 7.4+
> - Compatible with Laravel 8.x
> - All functionality preserved

 [ ![Build Status](https://github.com/InterNACHI/modular/actions/workflows/phpunit.yml/badge.svg) ](https://github.com/InterNACHI/modular/actions/workflows/phpunit.yml) [ ![Coverage Status](https://camo.githubusercontent.com/63ad996db67c330d17da89f1b08cd56a3de379a764dc8b49cb432e1d638de6ae/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f64643932373830326435326634663735656136632f746573745f636f766572616765) ](https://codeclimate.com/github/InterNACHI/modular/test_coverage) [ ![Latest Stable Release](https://camo.githubusercontent.com/63a91dc913fb7f4dbd336af2af3556fbddb890dc1a81a2158ae1b1d63f24b212/68747470733a2f2f706f7365722e707567782e6f72672f696e7465726e616368692f6d6f64756c61722f762f737461626c65) ](https://packagist.org/packages/internachi/modular) [ ![MIT Licensed](https://camo.githubusercontent.com/a03c49dce57cc9a0c932b29126f0f59b9ec3013022b86f0339d1df455ad0f65d/68747470733a2f2f706f7365722e707567782e6f72672f696e7465726e616368692f6d6f64756c61722f6c6963656e7365) ](./LICENSE) [ ![Follow @inxilpro on Twitter](https://camo.githubusercontent.com/e6d0a3893c652423c3a7c6aa648ca6e98a3b06899551e17a2fe5b33528244dcb/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f666f6c6c6f772f696e78696c70726f3f7374796c653d736f6369616c) ](https://twitter.com/inxilpro) [ ![Follow @chris@any.dev on Mastodon](https://camo.githubusercontent.com/4653377a822fb3e7af6b6b165003eef83ad6676e5f7eed369e75944f319fa014/68747470733a2f2f696d672e736869656c64732e696f2f6d6173746f646f6e2f666f6c6c6f772f3130393538343030313639333733393831333f646f6d61696e3d6874747073253341253246253246616e792e646576267374796c653d736f6369616c) ](https://any.dev/@chris)

`internachi/modular` is a module system for Laravel applications. It uses [Composer path repositories](https://getcomposer.org/doc/05-repositories.md#path) for autoloading, and [Laravel package discovery](https://laravel.com/docs/11.x/packages#package-discovery) for module initialization, and then provides minimal tooling to fill in any gaps.

This project is as much a set of conventions as it is a package. The fundamental idea is that you can create “modules” in a separate `app-modules/` directory, which allows you to better organize large projects. These modules use the existing [Laravel package system](https://laravel.com/docs/11.x/packages), and follow existing Laravel conventions.

- [Walkthrough Video](#walkthrough-video)
- [Installation](#installation)
- [Usage](#usage)
- [Comparison to `nwidart/laravel-modules`](#comparison-to-nwidartlaravel-modules)

Walkthrough Video
-----------------

[](#walkthrough-video)

[![Intro video](https://camo.githubusercontent.com/e594e200b0bd77a553f5e6f62889fb45b58b40daf424c14f92b812871e45e32d/68747470733a2f2f656d6265642d73736c2e7769737469612e636f6d2f64656c697665726965732f39386562633765303135333761363434646632643361663933643932383235372e6a70673f696d6167655f63726f705f726573697a65643d313630307839303026696d6167655f706c61795f627574746f6e3d7472756526696d6167655f706c61795f627574746f6e5f73697a653d327826696d6167655f706c61795f627574746f6e5f636f6c6f723d3165373165376530)](https://internachi.wistia.com/medias/pivaxithl7?wvideo=pivaxithl7)

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

[](#installation)

To get started, run:

```
composer require internachi/modular
```

Laravel will auto-discover the package and everything will be automatically set up for you.

### Publish the config

[](#publish-the-config)

While not required, it's highly recommended that you customize your default namespace for modules. By default, this is set to `Modules\`, which works just fine but makes it harder to extract your module to a separate package should you ever choose to.

We recommend configuring a organization namespace (we use `"InterNACHI"`, for example). To do this, you'll need to publish the package config:

```
php artisan vendor:publish --tag=modular-config
```

### Create a module

[](#create-a-module)

Next, let's create a module:

```
php artisan make:module my-module
```

Modular will scaffold up a new module for you:

```
app-modules/
  my-module/
    composer.json
    src/
    tests/
    routes/
    resources/
    database/

```

It will also add two new entries to your app's `composer.json` file. The first entry registers `./app-modules/my-module/` as a [path repository](https://getcomposer.org/doc/05-repositories.md#path), and the second requires `modules/my-module:*` (like any other Composer dependency).

Modular will then remind you to perform a Composer update, so let's do that now:

```
composer update modules/my-module
```

### Optional: Config synchronization

[](#optional-config-synchronization)

You can run the sync command to make sure that your project is set up for module support:

```
php artisan modules:sync
```

This will add a `Modules` test suite to your `phpunit.xml` file (if one exists) and update your [PhpStorm Laravel plugin](https://plugins.jetbrains.com/plugin/7532-laravel)configuration (if it exists) to properly find your module's views.

It is safe to run this command at any time, as it will only add missing configurations. You may even want to add it to your `post-autoload-dump` scripts in your application's `composer.json` file.

Usage
-----

[](#usage)

All modules follow existing Laravel conventions, and auto-discovery should work as expected in most cases:

- Commands are auto-registered with Artisan
- Migrations will be run by the Migrator
- Factories are auto-loaded for `factory()`
- Policies are auto-discovered for your Models
- Blade components will be auto-discovered
- Event listeners will be auto-discovered

### Commands

[](#commands)

#### Package Commands

[](#package-commands)

We provide a few helper commands:

- `php artisan make:module` — scaffold a new module
- `php artisan modules:cache` — cache the loaded modules for slightly faster auto-discovery
- `php artisan modules:clear` — clear the module cache
- `php artisan modules:sync` — update project configs (like `phpunit.xml`) with module settings
- `php artisan modules:list` — list all modules

#### Laravel “`make:`” Commands

[](#laravel-make-commands)

We also add a `--module=` option to most Laravel `make:` commands so that you can use all the existing tooling that you know. The commands themselves are exactly the same, which means you can use your [custom stubs](https://laravel.com/docs/11.x/artisan#stub-customization)and everything else Laravel provides:

- `php artisan make:cast MyModuleCast --module=[module name]`
- `php artisan make:controller MyModuleController --module=[module name]`
- `php artisan make:command MyModuleCommand --module=[module name]`
- `php artisan make:component MyModuleComponent --module=[module name]`
- `php artisan make:channel MyModuleChannel --module=[module name]`
- `php artisan make:event MyModuleEvent --module=[module name]`
- `php artisan make:exception MyModuleException --module=[module name]`
- `php artisan make:factory MyModuleFactory --module=[module name]`
- `php artisan make:job MyModuleJob --module=[module name]`
- `php artisan make:listener MyModuleListener --module=[module name]`
- `php artisan make:mail MyModuleMail --module=[module name]`
- `php artisan make:middleware MyModuleMiddleware --module=[module name]`
- `php artisan make:model MyModule --module=[module name]`
- `php artisan make:notification MyModuleNotification --module=[module name]`
- `php artisan make:observer MyModuleObserver --module=[module name]`
- `php artisan make:policy MyModulePolicy --module=[module name]`
- `php artisan make:provider MyModuleProvider --module=[module name]`
- `php artisan make:request MyModuleRequest --module=[module name]`
- `php artisan make:resource MyModule --module=[module name]`
- `php artisan make:rule MyModuleRule --module=[module name]`
- `php artisan make:seeder MyModuleSeeder --module=[module name]`
- `php artisan make:test MyModuleTest --module=[module name]`

#### Other Laravel Commands

[](#other-laravel-commands)

In addition to adding a `--module` option to most `make:` commands, we’ve also added the same option to the `db:seed` command. If you pass the `--module` option to `db:seed`, it will look for your seeder within your module namespace:

- `php artisan db:seed --module=[module name]` will try to call `Modules\MyModule\Database\Seeders\DatabaseSeeder`
- `php artisan db:seed --class=MySeeder --module=[module name]` will try to call `Modules\MyModule\Database\Seeders\MySeeder`

#### Vendor Commands

[](#vendor-commands)

We can also add the `--module` option to commands in 3rd-party packages. The first package that we support is Livewire. If you have Livewire installed, you can run:

- `php artisan make:livewire counter --module=[module name]`

### Blade Components

[](#blade-components)

Your [Laravel Blade components](https://laravel.com/docs/blade#components) will be automatically registered for you under a [component namespace](https://laravel.com/docs/9.x/blade#manually-registering-package-components). A few examples:

FileComponent`app-modules/demo/src/View/Components/Basic.php````app-modules/demo/src/View/Components/Nested/One.php````app-modules/demo/src/View/Components/Nested/Two.php````app-modules/demo/resources/components/anonymous.blade.php````app-modules/demo/resources/components/anonymous/index.blade.php````app-modules/demo/resources/components/anonymous/nested.blade.php```### Translations

[](#translations)

Your [Laravel Translations](https://laravel.com/docs/11.x/localization#defining-translation-strings) will also be automatically registered under a component namespace for you. For example, if you have a translation file at:

`app-modules/demo/resources/lang/en/messages.php`

You could access those translations with: `__('demo::messages.welcome');`

### Customizing the Default Module Structure

[](#customizing-the-default-module-structure)

When you call `make:module`, Modular will scaffold some basic boilerplate for you. If you would like to customize this behavior, you can do so by publishing the `app-modules.php`config file and adding your own stubs.

Both filenames and file contents support a number of placeholders. These include:

- `StubBasePath`
- `StubModuleNamespace`
- `StubComposerNamespace`
- `StubModuleNameSingular`
- `StubModuleNamePlural`
- `StubModuleName`
- `StubClassNamePrefix`
- `StubComposerName`
- `StubMigrationPrefix`
- `StubFullyQualifiedTestCaseBase`
- `StubTestCaseBase`

Comparison to `nwidart/laravel-modules`
---------------------------------------

[](#comparison-to-nwidartlaravel-modules)

[Laravel Modules](https://nwidart.com/laravel-modules) is a great package that’s been around since 2016 and is used by 1000's of projects. The main reason we decided to build our own module system rather than using `laravel-modules` comes down to two decisions:

1. We wanted something that followed Laravel conventions rather than using its own directory structure/etc.
2. We wanted something that felt “lighter weight”

If you are building a CMS that needs to support 3rd-party modules that can be dynamically enabled and disabled, Laravel Modules will be a better fit.

On the other hand, if you're mostly interested in modules for organization, and want to stick closely to Laravel conventions, we’d highly recommend giving InterNACHI/Modular a try!

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance70

Regular maintenance activity

Popularity0

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 89.2% 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 ~248 days

Total

2

Last Release

174d ago

PHP version history (2 changes)3.x-devPHP &gt;=8.3

v1.0.0PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![inxilpro](https://avatars.githubusercontent.com/u/21592?v=4)](https://github.com/inxilpro "inxilpro (189 commits)")[![ejunker](https://avatars.githubusercontent.com/u/4758?v=4)](https://github.com/ejunker "ejunker (3 commits)")[![bogdankharchenko](https://avatars.githubusercontent.com/u/32746389?v=4)](https://github.com/bogdankharchenko "bogdankharchenko (2 commits)")[![djallits](https://avatars.githubusercontent.com/u/10674226?v=4)](https://github.com/djallits "djallits (2 commits)")[![wilocampo](https://avatars.githubusercontent.com/u/17541572?v=4)](https://github.com/wilocampo "wilocampo (2 commits)")[![EgorGruzdev](https://avatars.githubusercontent.com/u/930669?v=4)](https://github.com/EgorGruzdev "EgorGruzdev (1 commits)")[![michaelconnelly](https://avatars.githubusercontent.com/u/20593484?v=4)](https://github.com/michaelconnelly "michaelconnelly (1 commits)")[![samlev](https://avatars.githubusercontent.com/u/462466?v=4)](https://github.com/samlev "samlev (1 commits)")[![skylerkatz](https://avatars.githubusercontent.com/u/7297992?v=4)](https://github.com/skylerkatz "skylerkatz (1 commits)")[![Sophist-UK](https://avatars.githubusercontent.com/u/3001893?v=4)](https://github.com/Sophist-UK "Sophist-UK (1 commits)")[![thearyanahmed](https://avatars.githubusercontent.com/u/20617352?v=4)](https://github.com/thearyanahmed "thearyanahmed (1 commits)")[![WebKenth](https://avatars.githubusercontent.com/u/13419123?v=4)](https://github.com/WebKenth "WebKenth (1 commits)")[![Wulfheart](https://avatars.githubusercontent.com/u/25671390?v=4)](https://github.com/Wulfheart "Wulfheart (1 commits)")[![avosalmon](https://avatars.githubusercontent.com/u/7438395?v=4)](https://github.com/avosalmon "avosalmon (1 commits)")[![zobay](https://avatars.githubusercontent.com/u/35206101?v=4)](https://github.com/zobay "zobay (1 commits)")[![cheyner](https://avatars.githubusercontent.com/u/146845?v=4)](https://github.com/cheyner "cheyner (1 commits)")[![da-mask](https://avatars.githubusercontent.com/u/1960334?v=4)](https://github.com/da-mask "da-mask (1 commits)")[![DanielCoulbourne](https://avatars.githubusercontent.com/u/429010?v=4)](https://github.com/DanielCoulbourne "DanielCoulbourne (1 commits)")[![eckelarsson](https://avatars.githubusercontent.com/u/2752093?v=4)](https://github.com/eckelarsson "eckelarsson (1 commits)")

---

Tags

laravelmodulemodulesmodular

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

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

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

###  Alternatives

[internachi/modular

Modularize your Laravel apps

1.1k662.4k8](/packages/internachi-modular)[artem-schander/l5-modular

Modular pattern generator for Laravel

223235.5k](/packages/artem-schander-l5-modular)[pingpong/modules

Laravel Modules

592188.7k13](/packages/pingpong-modules)

PHPackages © 2026

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