PHPackages                             saeedhosan/module-support - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. saeedhosan/module-support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

saeedhosan/module-support
=========================

The package support for the Laravel module.

v0.0.1(3mo ago)06151MITPHPPHP ^8.2CI passing

Since Apr 11Pushed 3mo agoCompare

[ Source](https://github.com/saeedhosan/module-support)[ Packagist](https://packagist.org/packages/saeedhosan/module-support)[ RSS](/packages/saeedhosan-module-support/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (5)Versions (3)Used By (1)

Module Support for Laravel
==========================

[](#module-support-for-laravel)

Your friendly companion for building modular Laravel applications. This package makes it dead simple to organize your Laravel app into self-contained modules with their own structure.

What is this?
-------------

[](#what-is-this)

Think of modules as building blocks for your Laravel app. Instead of dumping everything into `app/Http/Controllers`, `app/Models`, and friends, you can group related functionality into modules. Each module can have its own controllers, models, views, migrations—everything it needs to work independently.

This package gives you the tools to discover, manage, and work with those modules effortlessly.

Requirements
------------

[](#requirements)

- **PHP**: 8.2 or newer
- **Laravel**: 11, 12, or 13

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

[](#installation)

Install via Composer:

```
composer require saeedhosan/module-support
```

The service provider registers itself automatically, so you're good to go—no extra setup needed.

Configuration
-------------

[](#configuration)

Want to customize how modules are organized? Publish the config file:

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

Here's what you can tweak in `config/module.php`:

```
[
    'directory' => 'modules',      // Where your modules live
    'namespace' => 'Modules',       // The root namespace for modules
    'lowercase' => true,            // Normalize module names to lowercase
    'vendor' => 'modules',          // Vendor directory for module packages
    'view_path' => 'resources/views',
    'app_path' => 'app',
]
```

Quick Start
-----------

[](#quick-start)

### Module Structure

[](#module-structure)

A typical module looks like this:

```
modules/
└── Blog/
    ├── app/
    │   ├── Http/
    │   │   └── Controllers/
    │   └── Models/
    ├── resources/
    │   └── views/
    ├── routes/
    ├── composer.json
    └── ...

```

Each module has its own `composer.json` that defines its namespace and autoloading—just like a regular package.

### Working with Modules

[](#working-with-modules)

**Get a specific module:**

```
use SaeedHosan\Module\Support\ModuleManager;

$modules = app(ModuleManager::class);

$blog = $modules->module('blog');

// Or use the helper
$blog = module('blog');

$blog->name();        // "Blog"
$blog->path();        // "/path/to/modules/Blog"
$blog->namespace();  // "Modules\Blog"
$blog->version();    // "1.0.0"
$blog->exists();     // true/false
$blog->active();     // true/false (checks if autoloaded & discovered)
```

**Loop through all modules:**

```
foreach (module()->all() as $module) {
    echo $module->name();
    echo $module->path();
}
```

**Check if a module exists:**

```
if (module()->find('blog')) {
    // Blog module is here and ready to go
}
```

**Get module info from its composer.json:**

```
$module = module('blog');

$module->composer();      // Full composer.json contents
$module->providers();     // ['Modules\Blog\Providers\BlogServiceProvider']
$module->description();   // "A simple blogging module"
```

### Helpers

[](#helpers)

We've got a couple of handy helpers up our sleeves:

```
// Get the module manager
module();

// Get a specific module
module('blog');

// Get all modules
module()->all();

// Check if a module exists
module()->find('blog');
```

### Blade Components

[](#blade-components)

This package includes a `` Blade component for conditionally rendering content based on module status:

```
{{-- Show content only if the Blog module is active --}}

        Welcome to our Blog!

```

The component accepts these attributes:

- `name` (required): The module name to check
- `title` (optional): Fallback title for the error message

If the module is not active, it displays a placeholder message. You can also customize the wrapper styles using standard HTML attributes:

```

    Blog content here

```

### Blade Directives

[](#blade-directives)

The package provides a `@module` directive for conditionally including content:

```
@module('blog')
    Blog module is active and ready!
@endmodule

@module('payments')
    Payment features available
@endmodule
```

### Bootstrapping Module Providers

[](#bootstrapping-module-providers)

If your module has service providers defined in its `composer.json`, you can register them manually:

```
$module = module('blog');
$module->register();
```

Or use the manager:

```
app(ModuleManager::class)->registerProviders([
    'Modules\Blog\Providers\BlogServiceProvider',
]);
```

Testing
-------

[](#testing)

The package comes with a solid test suite. Make sure everything still works:

```
composer test
```

Contributing
------------

[](#contributing)

Found a bug or want to add a feature? Pull requests are totally welcome. Just make sure the tests pass before submitting.

---

**Module support** was created by **[Saeed Hosan](https://www.linkedin.com/in/saeedhosan)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance81

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

2

Last Release

99d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f8ebeaa5852b0579934881dcb0e479ab2c970960774be27e224db9ee005cffe?d=identicon)[saeedhosan](/maintainers/saeedhosan)

---

Top Contributors

[![saeedhosan](https://avatars.githubusercontent.com/u/78552486?v=4)](https://github.com/saeedhosan "saeedhosan (27 commits)")

---

Tags

laravelmodulesupportlaravel-modulesaeedhosanmodule-support

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[firefly-iii/data-importer

Firefly III Data Import Tool.

8055.8k](/packages/firefly-iii-data-importer)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[ronasit/laravel-helpers

Provided helpers function and some helper class.

2085.6k31](/packages/ronasit-laravel-helpers)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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