moddril / modularsystem
Laravel Modular Domain Package
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/moddril/modularsystem
Requires
- php: ^8.1
This package is not auto-updated.
Last update: 2026-02-27 06:52:30 UTC
README
A lightweight Laravel modular domain system for building scalable, domain-driven applications.
🚀 Introduction
ModDril Modular System provides a clean and structured way to build Laravel applications using a Domain-based modular architecture.
Each module:
- Has its own Service Provider
- Loads its own routes automatically
- Can be enabled or disabled
- Is fully isolated
- Is registered dynamically
Perfect for large applications, SaaS platforms, and Domain-Driven Design (DDD).
📦 Installation
Install via Composer:
composer require moddril/modularsystem
⚙ Publish Configuration (Optional)
php artisan vendor:publish --tag=moddril-config
This will publish:
config/moddril.php
🏗 Create a Module
php artisan make:module User
This will generate:
app/Domains/User/
├── Http/
│ ├── Controllers/
│ └── Requests/
├── Services/
├── Repositories/
├── Providers/
│ └── UserServiceProvider.php
├── Routes/
│ └── web.php
It will also register the module inside:
app/Domains/modules.json
🎮 Create a Module Controller
You can create a controller inside a specific domain using:
php artisan make:module-controller {domain} {controller}
Examples
Create a simple controller:
php artisan make:module-controller User UserController
Create a controller inside subfolders:
php artisan make:module-controller User Admin/UserController
This will generate: Or if using subfolders: If the directory does not exist, it will be created automatically.
If the controller already exists, the command will prevent overwriting it.
🔄 Enable / Disable Module
php artisan module:status {domain} {status}
Example:
php artisan module:status User enabled php artisan module:status User disabled
📋 List All Modules
php artisan module:list
Example output:
+----------+----------+
| Module | Status |
+----------+----------+
| Admin | Enabled |
| User | Disabled |
+----------+----------+
📄 modules.json Structure
Location:
app/Domains/modules.json
Example:
{
"Admin": {
"enabled": true
},
"User": {
"enabled": false
}
}
Only enabled modules are automatically registered.
✅ Requirements
- PHP 8.1+
- Laravel 10+
📄 License
This package is open-sourced software licensed under the MIT license.