PHPackages                             glugox/module - 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. glugox/module

ActiveLibrary[Framework](/categories/framework)

glugox/module
=============

Module abstractions that all modules use

1.0.0(6mo ago)025[1 PRs](https://github.com/glugox/module/pulls)1MITPHPPHP &gt;=8.2

Since Oct 24Pushed 6mo agoCompare

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

READMEChangelogDependencies (14)Versions (7)Used By (1)

glugox/module – Documentation
=============================

[](#glugoxmodule--documentation)

Introduction
------------

[](#introduction)

The `glugox/module` package defines the **foundation for modular development** in Laravel. It introduces the common abstractions, contracts, and base classes that every module must use. This ensures consistency across all modules and makes it possible for tools like `glugox/orchestrator` and `glugox/module-generator` to integrate seamlessly.

---

Key Concepts
------------

[](#key-concepts)

### 1. Module Abstraction

[](#1-module-abstraction)

- A module is a self-contained package that adds functionality to a Laravel app.
- Every module must implement the `ModuleContract` or extend the abstract `Module` base class.
- A module contains its own routes, migrations, views, assets, and service providers.

### 2. Module Manifest

[](#2-module-manifest)

- The manifest describes the metadata of a module.
- It includes: `id`, `name`, `namespace`, `description`, `version`, and `capabilities`.
- It allows orchestrators to discover and load modules without knowing implementation details.

### 3. Contracts

[](#3-contracts)

Located in `src/Contracts`, they enforce module capabilities:

- `ModuleContract` → defines required metadata methods.
- `HasRoutes`, `HasMigrations`, `HasViews`, `HasAssets` → optional feature interfaces.
- `ManifestContract` → for objects that expose manifest data.

### 4. Support Classes

[](#4-support-classes)

- `ModuleManifest` → value object holding module metadata.
- `ModuleLoader` → utility to bootstrap and resolve modules.

### 5. Service Provider Integration

[](#5-service-provider-integration)

- `ModuleServiceProvider` ensures that modules can register services into Laravel’s container and lifecycle.

---

Package Structure
-----------------

[](#package-structure)

```
glugox/module/
├── src/
│   ├── Contracts/
│   │   ├── ModuleContract.php
│   │   ├── ManifestContract.php
│   │   ├── HasRoutes.php
│   │   ├── HasViews.php
│   │   ├── HasMigrations.php
│   │   └── HasAssets.php
│   ├── Support/
│   │   ├── ModuleManifest.php
│   │   └── ModuleLoader.php
│   ├── Module.php
│   └── ModuleServiceProvider.php
└── composer.json

```

---

Example Implementation
----------------------

[](#example-implementation)

### Defining a Module

[](#defining-a-module)

```
use Glugox\Module\Module;
use App\Providers\BillingServiceProvider;

class BillingModule extends Module
{
    public function id(): string { return 'company/billing'; }
    public function name(): string { return 'Billing'; }
    public function description(): string { return 'Invoices and payments'; }
    public function version(): string { return '1.0.0'; }
    public function capabilities(): array { return ['http:web', 'http:api']; }

    public function serviceProvider(): string
    {
        return BillingServiceProvider::class;
    }

    public function routesPath(): ?string
    {
        return __DIR__ . '/routes/web.php';
    }
}

```

### Example Manifest

[](#example-manifest)

```
{
  "id": "company/billing",
  "name": "Billing",
  "namespace": "Company\\Billing",
  "description": "Invoices and payments",
  "version": "1.0.0",
  "capabilities": ["http:web", "http:api"]
}

```

---

How It Fits in the Ecosystem
----------------------------

[](#how-it-fits-in-the-ecosystem)

- **`glugox/module-generator`** creates modules that extend the `Module` base class.
- **`glugox/orchestrator`** loads modules by reading their manifests and registering providers.
- **Main Laravel App** → simply requires modules as composer packages and lets orchestrator manage them.

---

Benefits
--------

[](#benefits)

- **Standardization** → Every module follows the same pattern.
- **Reusability** → Modules can be reused across multiple Laravel projects.
- **Separation of Concerns** → Clear split between contracts (in `glugox/module`), orchestration (in `glugox/orchestrator`), and generation (in `glugox/module-generator`).

---

Next Steps
----------

[](#next-steps)

- Finalize the `ModuleContract` and optional feature interfaces.
- Improve `ModuleLoader` to handle different discovery strategies (filesystem, composer).
- Document how modules interact with Laravel’s container and lifecycle in detail.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance66

Regular maintenance activity

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

206d ago

### Community

Maintainers

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

---

Top Contributors

[![glugox](https://avatars.githubusercontent.com/u/13313019?v=4)](https://github.com/glugox "glugox (3 commits)")

---

Tags

frameworklaravelpackagemoduleglugox

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/glugox-module/health.svg)

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

###  Alternatives

[jsdecena/laracom

Laravel powered e-commerce

2.0k4.4k](/packages/jsdecena-laracom)

PHPackages © 2026

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