PHPackages                             hexters/laramodule - 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. hexters/laramodule

ActiveLibrary

hexters/laramodule
==================

Laramodule is an HMVC pattern for the Laravel framework.

4.0.3(2y ago)322.8k↓100%7MITPHP

Since Mar 23Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hexters/laramodule)[ Packagist](https://packagist.org/packages/hexters/laramodule)[ RSS](/packages/hexters-laramodule/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (30)Used By (0)

Laravel HMVC V4
===============

[](#laravel-hmvc-v4)

[![Latest Stable Version](https://camo.githubusercontent.com/cf42f2963618e10acf46591242b274b3cab372269f2439adb47cc90cc84cb311/68747470733a2f2f706f7365722e707567782e6f72672f686578746572732f6c6172616d6f64756c652f762f737461626c65)](https://packagist.org/packages/hexters/laramodule)[![Total Downloads](https://camo.githubusercontent.com/afd791289d9a5b884e375f992ddea3941c0e4b0008195c9c111dd8fd4b5aeba4/68747470733a2f2f706f7365722e707567782e6f72672f686578746572732f6c6172616d6f64756c652f646f776e6c6f616473)](https://packagist.org/packages/hexters/laramodule)[![License](https://camo.githubusercontent.com/f1ba6cd8e75f2cee1c515befbdb81d7aac46de6afa3f5017da3a3a8c8516d3fd/68747470733a2f2f706f7365722e707567782e6f72672f686578746572732f6c6172616d6f64756c652f6c6963656e7365)](https://packagist.org/packages/hexters/laramodule)

Laramodule is a package for the Laravel framework that allows developers to organize and manage modules within their web application. It is designed to make it easy to create, manage and reuse modular components within a Laravel application.

With Laramodule, developers can create new modules that can be easily added to their application, and can also manage existing modules. It also allows developers to keep their code organized and maintainable, by separating different functionality into different modules. Each module can include its own controllers, views, routes, and other components.

Laramodule also provides an easy to use API for interacting with modules and their components. This allows developers to perform tasks such as enabling or disabling modules, and accessing module specific data or functionality.

Laramodule is a powerful tool for developers who want to create modular and maintainable applications with Laravel. It can help developers to speed up development, improve code quality and maintain a cleaner structure of their application.

Doc. Versions
-------------

[](#doc-versions)

VersionDoc.V3[Read Me](https://github.com/hexters/laramodule/blob/main/src/releasedoc/v3.md)To install through Composer, by run the following command:

```
composer require hexters/laramodule
```

Autoloading
-----------

[](#autoloading)

By default the module classes are not loaded automatically. You can autoload your modules using `psr-4`. For example :

```
{
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "Modules\\": "Modules/",
      "Database\\Factories\\": "database/factories/",
      "Database\\Seeders\\": "database/seeders/"
    }
  }
}
```

And make `Modules` directory in your root project folder

```
mkdir Modules
```

Don't forget to run the commands below

```
composer dump-autoload
```

Managing assets
---------------

[](#managing-assets)

Install node module pacakge

```
npm install -D @hexters/ladmin-vite-input
```

Open `vite.config.js` in your project and follow the instruction below.

```
. . .
import ladminViteInputs from '@hexters/ladmin-vite-input'
. . .

export default defineConfig({
    plugins: [
        laravel({
            input: ladminViteInputs([
                'resources/css/app.css',
                'resources/js/app.js'
            ]),
            refresh: true,
        }),
    ],
});
```

Install the node module package in all module folders

```
php artisan module:npm --install
php artisan module:npm --update
```

And run the vite command below

```
npm run dev

npm run build
```

Artisan
-------

[](#artisan)

```
php artisan module:make Blog --command=OPTIONAL
php artisan module:make-cast BlogCast --module=Blog
php artisan module:make-channel BlogChannel --module=Blog
php artisan module:make-command BlogCommand --module=Blog
php artisan module:make-component BlogComponent --module=Blog
php artisan module:make-controller BlogController --module=Blog
php artisan module:make-event BlogEvent --module=Blog
php artisan module:make-exception BlogException --module=Blog
php artisan module:make-factory BlogFactory --module=Blog
php artisan module:make-job BlogJob --module=Blog
php artisan module:make-listener BlogListener --module=Blog
php artisan module:make-mail BlogMail --module=Blog
php artisan module:make-middleware BlogMiddleware --module=Blog
php artisan module:make-migration BlogMigration --module=Blog
php artisan module:make-model BlogModel --module=Blog
php artisan module:make-notification BlogNotification --module=Blog
php artisan module:make-observer BlogObserver --module=Blog
php artisan module:make-policy BlogPolicy --module=Blog
php artisan module:make-provider BlogProvider --module=Blog
php artisan module:make-request BlogRequest --module=Blog
php artisan module:make-resource BlogResource --module=Blog
php artisan module:make-rule BlogRule --module=Blog
php artisan module:make-scope BlogScope --module=Blog
php artisan module:make-seeder BlogSeeder --module=Blog
php artisan module:make-test BlogTest --module=Blog
php artisan module:publish Blog
```

Happy coding ☕

Livewire Support
================

[](#livewire-support)

We have a livewire version but it is still in the experimental stage, please see the full documentation below.

### [Livewire HMVC Documentation](https://github.com/hexters/wirehmvc)

[](#livewire-hmvc-documentation)

Inertia Support
===============

[](#inertia-support)

Laramodule is already supported for integration with InertiaJs. Follow the official Inertia.js website to see the installation steps. [inertiajs.com](https://inertiajs.com)

Inertia with VueJs
------------------

[](#inertia-with-vuejs)

Follow the command below to create a module and select `Inertia With VueJs` in preset options.

```
php artisan module:make Blog
```

You can run the command initialize inertia with vue for an existing module as below, but remember that. The `route.php` file will be replaced by a new file.

```
php artisan module:inertia-vue --module=Blog
```

Create a new javascript file in your root project directory with name `inertia.js` and paste code below.

```
import { createApp, h } from 'vue'
import { createInertiaApp } from '@inertiajs/vue3'

const getPage = (name) => {

    let names = (name).split('::');
    let module = names.shift();
    let page = names.pop();

    const pages = import.meta.glob('./Modules/**/*.vue', { eager: true })
    return pages[`./Modules/${module}/Resources/pages/${page}.vue`]
}

createInertiaApp({
    resolve: getPage,
    setup({ el, App, props, plugin }) {
        createApp({ render: () => h(App, props) })
            .use(plugin)
            .mount(el)
    },
})
```

Add `inertia.js` to `vite.config.js`

```
. . .

export default defineConfig({
    plugins: [
        vue(),
        laravel({
            input: ladminViteInputs([
                'resources/css/app.css',
                'resources/js/app.js',

                'inertia.js', //  {

    let names = (name).split('::');
    let module = names.shift();
    let page = names.pop();

    return resolvePageComponent(
        `./Modules/${module}/Resources/pages/${page}.jsx`,
        import.meta.glob('./Modules/**/*.jsx', { eager: true })
    );
}

createInertiaApp({
    resolve: getPage,
    setup({ el, App, props }) {
        createRoot(el).render()
    },
})
```

Add `inertia.jsx` to `vite.config.js`

```
. . .
import react from '@vitejs/plugin-react';

export default defineConfig({
    plugins: [
        react(),
        laravel({
            input: ladminViteInputs([
                'resources/css/app.css',
                'resources/js/app.js',

                'inertia.jsx', //  [
        // ...
    ],

    ModuleEnabled::class => [
        // ...
    ],
];
```

Supporting the project
======================

[](#supporting-the-project)

You can support the maintainer of this project through the referral links below

- [**Sign up for DigitalOcean**](https://www.digitalocean.com/?refcode=36844cd4f4b4&utm_campaign=Referral_Invite&utm_medium=Referral_Program&utm_source=badge)
- [**PayPal**](https://paypal.me/asepss19)

Follow package updates on my X [@hexters](https://twitter.com/hexters)

###  Health Score

34

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 99.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 ~20 days

Recently: every ~6 days

Total

29

Last Release

890d ago

Major Versions

1.0.7 → 2.0.02023-01-29

2.0.6 → 3.0.02023-02-16

3.2.2 → 4.0.02023-10-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d97e7edbbe58dd16d6f776aec2dacf66c5aeb730b9a4aa3de34ca0c1ebbfb9e?d=identicon)[hexters](/maintainers/hexters)

---

Top Contributors

[![hexters](https://avatars.githubusercontent.com/u/7827420?v=4)](https://github.com/hexters "hexters (119 commits)")[![wtfz](https://avatars.githubusercontent.com/u/9669062?v=4)](https://github.com/wtfz "wtfz (1 commits)")

---

Tags

hmvc-frameworklaravelmodular-designphplaravellaravel-packagelaravel-modulelaravel-modularlaravel hmvc

### Embed Badge

![Health badge](/badges/hexters-laramodule/health.svg)

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

###  Alternatives

[imanghafoori/laravel-nullable

A package to help you write expressive defensive code in a functional manner

151406.3k5](/packages/imanghafoori-laravel-nullable)[joisarjignesh/bigbluebutton

BigBlueButton Server API Library for Laravel

162143.3k1](/packages/joisarjignesh-bigbluebutton)[classiebit/eventmie

Run your own Events business with Eventmie Pro. Use it as event ticket selling website or event management platform on your own domain.

1862.0k](/packages/classiebit-eventmie)[stevegrunwell/lost-in-translation

Uncover missing translations and localization strings in Laravel applications

3635.4k](/packages/stevegrunwell-lost-in-translation)[musahmusah/laravel-multipayment-gateways

A Laravel Package that makes implementation of multiple payment Gateways endpoints and webhooks seamless

852.2k1](/packages/musahmusah-laravel-multipayment-gateways)[ashallendesign/laravel-mailboxlayer

A lightweight Laravel package for validating emails using the Mailbox Layer API.

762.0k](/packages/ashallendesign-laravel-mailboxlayer)

PHPackages © 2026

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