pushberryfinn / laravel-domains
A laravel package that manges, creates domains(modules)
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/pushberryfinn/laravel-domains
Requires
- php: ^8.2
- illuminate/support: ^11.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-12-08 18:48:17 UTC
README
A Laravel package to manage and create modular domains inside your Laravel app.
Overview
This package helps you organize your Laravel application by grouping related code (models, controllers, migrations, routes, commands, etc.) into domains — folders inside app/Domains. It supports automatic loading of routes, migrations, and commands per domain.
Features
- Generate domain folders with a service provider, routes, and basic structure
- Artisan commands to create domain resources like models, controllers, and migrations inside the domain folder
- Automatic discovery of all domains under
app/Domainsand bootstrapping routes, migrations, and commands - Command auto-registration inside each domain’s
Console/Commandsfolder
Installation
Require the package via composer:
composer require pushberryfinn/laravel-domains
Publish the package's service provider (if needed):
php artisan vendor:publish --provider="Pushberryfinn\LaravelDomains\LaravelDomainsServiceProvider"
Usage
Create a domain
php artisan domain:make Doctors
This will create:
app/Domains/DoctorsDomainsServiceProvider.phpinside the domain folder- A
routes/api.phpfile - The necessary folder structure for models, controllers, commands, migrations, etc.
Generate domain resources
Example: Create a model inside the Doctors domain
php artisan domain:make-model Doctor --domain=Doctors
Similarly, you can create controllers, migrations, and commands scoped to your domain:
php artisan domain:make-controller DoctorController --domain=Doctors php artisan domain:make-migration create_doctors_table --domain=Doctors php artisan domain:make-command SyncDoctors --domain=Doctors
How it works
- Your domains live inside
app/Domains. - The main
DomainsServiceProviderautomatically loads routes, migrations, and commands from each domain. - Commands are auto-registered if placed inside the domain's
Console/Commandsdirectory.
Requirements
- PHP 7.4 or higher
- Laravel 8.x
License
The MIT License (MIT). See the LICENSE file for details.
Author
Atdhe Krasniqi — GitHub