PHPackages                             saeedhosan/module-console - 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. [CLI &amp; Console](/categories/cli)
4. /
5. saeedhosan/module-console

ActiveLibrary[CLI &amp; Console](/categories/cli)

saeedhosan/module-console
=========================

The package provides console and commands for Laravel module.

v0.0.2(2mo ago)0244[1 PRs](https://github.com/saeedhosan/module-console/pulls)MITPHPPHP ^8.2.0CI passing

Since Apr 12Pushed 2mo agoCompare

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

READMEChangelog (3)Dependencies (6)Versions (6)Used By (0)

Module Console
==============

[](#module-console)

This package extends every Laravel artisan `make` command with a `--module` flag, so you can generate models, controllers, migrations, and more directly inside any module. It also scaffolds entire module skeletons in one command and lets you publish and customize the stubs to fit your workflow.

### Alternative

[](#alternative)

There are many alternative packages for creating module skeletons, but they don't give you much flexibility and are auto-discovered. This package gives you full control over your modules.

Here are a few popular packages:

- nwidart/laravel-modules
- internachi/modular
- joshbrw/laravel-module-installer

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

[](#requirements)

- PHP 8.2+
- Laravel 11, 12, or 13

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

[](#installation)

Install via Composer:

```
composer require saeedhosan/module-console --dev
```

Suggestions
-----------

[](#suggestions)

After creating a module, you need to load it into your application. Here are **two ways** (A, B) to do it:

**A. Use Composer path repositories (recommended)**

Add this to your root `composer.json` so Composer treats every module as a local package:

```
"repositories": [
    {
        "type": "path",
        "url": "modules/*",
        "options": {
            "symlink": true
        }
    }
]
```

Then require the module like any Composer package:

```
composer require modules/blog
```

Composer will symlink it and auto-discover the service provider — no manual registration needed.

**B. Add the module namespace manually**

Register the module's namespace in your `composer.json`:

```
"autoload": {
    "psr-4": {
        "Modules\\Blog\\": "modules/blog/app/"
    }
}
```

Then run `composer dump-autoload` and register the service provider in `bootstrap/providers.php`:

```
Modules\Blog\BlogServiceProvider::class,
```

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

[](#configuration)

Want to customize the generated files? Publish the stubs and edit them however you like:

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

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)

Create your first module:

```
php artisan make:module blog
```

This generates a clean module structure based on stubs:

```
modules/blog/
├── app/
│   └── BlogServiceProvider.php
├── config/
│   └── blog.php
├── database/
│   ├── factories/
│   ├── migrations/
│   └── seeders/
├── resources/
│   └── views/
├── routes/
│   └── web.php
├── tests/
│   └── example.php
├── composer.json
└── README.md

```

Every Laravel `make` command works with modules too. Just pass the `--module` flag:

```
php artisan make:model Post --module=blog
php artisan make:enum PostStatus --module=blog
php artisan make:controller PostController --module=blog
php artisan make:migration create_posts_table --module=blog
```

This package supports almost all `make:*` commands to create something inside a module.

```
php artisan make:YourMakeCommand YourClassName --module=ModuleName
```

See all your modules:

```
php artisan module:list
```

Testing
-------

[](#testing)

```
npm run test          # Everything (lint + types + unit)
npm run test:lint     # Code style (Pint)
npm run test:types    # Static analysis (PHPStan)
npm run test:unit     # Unit tests (Pest)
```

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 Console** was created by **[Saeed Hosan](https://www.linkedin.com/in/saeedhosan)** under the **[MIT license](https://opensource.org/licenses/MIT)**.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance88

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

Every ~20 days

Total

3

Last Release

64d 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 (28 commits)")

---

Tags

consolelaravelmodulelaravel-modulesaeedhosanmodule-console

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[ronasit/laravel-entity-generator

Provided console command for generating entities.

2053.1k](/packages/ronasit-laravel-entity-generator)[api-platform/laravel

API Platform support for Laravel

58174.6k17](/packages/api-platform-laravel)[ecotone/laravel

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

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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