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

ActiveLibrary[Framework](/categories/framework)

itvisionsy/laravel-modules
==========================

Laravel 5.1 library to allow modules structure. Each module can have its routes, controllers, views, config, ...

v1.2.2(9y ago)0261MITHTMLPHP &gt;=5.5.9

Since Mar 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/itvisionsy/laravel-modules)[ Packagist](https://packagist.org/packages/itvisionsy/laravel-modules)[ RSS](/packages/itvisionsy-laravel-modules/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (4)Versions (9)Used By (0)

laravel-modules
===============

[](#laravel-modules)

Modules management library for laravel 5.1

![Packagist](https://camo.githubusercontent.com/6086f99c71d0bda930068c9e212e7d315904a35b9c88be617427f6857aee6681/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6974766973696f6e73792f6c61726176656c2d6d6f64756c65732e737667)![license](https://camo.githubusercontent.com/e6863d269098037fccdaf69e0231afd79248a54e6bdf0b6e17beee2ceb748868/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6974766973696f6e73792f6c61726176656c2d6d6f64756c65732e737667)[![Build Status](https://camo.githubusercontent.com/9348493b125560254eb5285859b7174b6dda27e818bc817f84a6e220d3b8f00d/68747470733a2f2f7472617669732d63692e6f72672f6974766973696f6e73792f6c61726176656c2d6d6f64756c65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/itvisionsy/laravel-modules)![PHP](https://camo.githubusercontent.com/8a0a97b8183b3c2d386dc896334b7bb663bf7f8f960668730e9cf956533d5f1e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e362b2d3446354239332e737667)![Laravel](https://camo.githubusercontent.com/debf3e02a29ed710a46e10243c0fd84e35d89608988b4aad68459fb0f0fae8f9/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d352e312d6634363435662e737667)

Allows modules structure of your project. Each module can have its views, config, routes, controllers, ...

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

[](#installation)

1. The package relies on the composer PSR-4 loader like all laravel projects. Use the composer command: ```
    composer require itvisionsy/laravel-modules

    ```
2. Add `\ItvisionSy\Laravel\Modules\ServiceProvider::class` to providers section in your `config/app.php` file: ```
    'providers'=>[
       //...
       \ItvisionSy\Laravel\Modules\ServiceProvider::class,
    ],
    ```
3. Publish the config file using the command ```
    php artisan vendor:publish

    ```

    This will copy the `modules.php` config file to your `config` folder.
4. Modify the `config/modules.php` config file as needed.

How It Works
------------

[](#how-it-works)

Your modules should go in a root modules folder. By default this is `app/Modules` which maps to the namespace `\App\Modules`.

Each of your modules will have its own folder inside the modules root folder, the folder will be named after the module name, and will map to the namespace `\App\Modules\{ModuleName}`.

Each module will contain a base module definition class, which (by default) will be named `Module.php` and maps to the namespace `\App\Modules\{ModuleName}\Module`. This class will act as the key generator for the module URLs, routes, and other framework-related values.

Each module will contain its data models, controllers, views, routes, and other project files as usual. The `composer`PSR-4 loader should take care of loading your module files and classes properly.

Your module controllers (by default go into the `Http/Controllers` folder) should inherite the `ItvisionSy\Laravel\Modules\Controller` class to make views rendering and other tasks easier.

Creating Modules
----------------

[](#creating-modules)

To create a new module, you can use the artisan command

```
php artisan modules:make {id} [{name}] [--url={url}]

```

Values of `id`, `name`, and `url` are strings. The name and URL parts are optional. URL will be used to generate the URLs of the module more human friendly. Name is used for human identification and readability only.

This command will create the basic folder structure inside the modules folder, along with the base module and a sample routes (inside `Http/routes.php`), controller (inside `Http/Controllers/`), and view (inside `Views`).

As you have the basic structure, you can start creating your files and classes as normal. Nothing special to worry about.

What is Store Handler
---------------------

[](#what-is-store-handler)

It is a feature allows a per-module configuration to be saved in the database, in addition to a flag to identify if a module is enabled or disabled.

You need a class that implements the `ItvisionSy\Laravel\Modules\Interfaces\KeyValueStoreInterface` interface, which defines two methods: `set($key, $value)` and `get($key, $default=null)`.

There are two ready-made implementations in the `\ItvisionSy\Laravel\Modules\StoreHandlers\` namespace, one is calle `MysqlSimpleDbStoreHandler` and the other `SqliteSimpleDbStoreHandler`, which utilizes a DB connection (default one by default) to store the config in a simple key/value table.

The feature comes disabled by default by setting the class `\ItvisionSy\Laravel\Modules\StoreHandlers\DummyStoreHandler`as the store handler. To enable it, just change the `store_handler` config setting in the `config/modules.php` config file to use one of the two classes mentioned above.

```
//config/modules.php config file

'store_handler' => \ItvisionSy\Laravel\Modules\StoreHandlers\SqliteSimpleDbStoreHandler::class,
```

Also, you need to create the database table for the store. We provided a simple artisan command to do that. After you have configured everything correctly, simply execute the following command: `php artisan modules:db:init`which will take care about creating the database table by executing the following SQL command:

```
CREATE TABLE IF NOT EXISTS `modules_storage` (
  `key` VARCHAR(200) UNIQUE NOT NULL PRIMARY KEY,
  `value` VARCHAR(200) NULL
);
```

You can create the table manually, and override its name by extending the class and change the `$tableName` property.

Thanks
------

[](#thanks)

- [JetBrains](https://www.jetbrains.com/) for the free license of [PHPStorm IDE](https://www.jetbrains.com/phpstorm/specials/phpstorm/phpstorm.html). The great tool I wrote this module with.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~3 days

Total

8

Last Release

3369d ago

Major Versions

v0.0.1 → v1.0.02017-03-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/11ac511b34acf3f7e9a138d3b1a0a868303b376ab991bb176e8ea474857a0e57?d=identicon)[mhh1422](/maintainers/mhh1422)

---

Top Contributors

[![mhh1422](https://avatars.githubusercontent.com/u/499764?v=4)](https://github.com/mhh1422 "mhh1422 (42 commits)")

---

Tags

laravellaravel-modulesphplaravelmodules

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[laravel/octane

Supercharge your Laravel application's performance.

4.0k24.7M206](/packages/laravel-octane)[unopim/unopim

UnoPim Laravel PIM

10.5k2.2k](/packages/unopim-unopim)[statamic/statamic

Statamic

829179.5k](/packages/statamic-statamic)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[mhmiton/laravel-modules-livewire

Using Laravel Livewire in Laravel Modules package with automatically registered livewire components for every modules.

234455.5k9](/packages/mhmiton-laravel-modules-livewire)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21313.7k3](/packages/ecotone-laravel)

PHPackages © 2026

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