PHPackages                             pushberryfinn/laravel-domains - 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. pushberryfinn/laravel-domains

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

pushberryfinn/laravel-domains
=============================

A Laravel package to manage and create modular domains inside your app

8103PHPCI failing

Since May 25Pushed 1mo agoCompare

[ Source](https://github.com/pushberryfinn/laraveldomains)[ Packagist](https://packagist.org/packages/pushberryfinn/laravel-domains)[ RSS](/packages/pushberryfinn-laravel-domains/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Laravel Domains
===============

[](#laravel-domains)

[![Latest Version on Packagist](https://camo.githubusercontent.com/22316fd9cd247fff65bc003094f5c31d647643aafd133ceb4a7f8231a666d4dd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70757368626572727966696e6e2f6c61726176656c2d646f6d61696e732e737667)](https://packagist.org/packages/pushberryfinn/laravel-domains)[![Tests](https://github.com/pushberryfinn/laravel-domains/actions/workflows/tests.yml/badge.svg)](https://github.com/pushberryfinn/laravel-domains/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/fd87127c2045a5645b0bc2e763b6cbfe3fe178584d9246f4dd89f933d6bce7bf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f70757368626572727966696e6e2f6c61726176656c2d646f6d61696e732e737667)](https://packagist.org/packages/pushberryfinn/laravel-domains)[![PHP Version](https://camo.githubusercontent.com/5567a208ad61b68fef2aba623a1b5d4b6104a6a4b896766905c7ed22137b9f57/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f70757368626572727966696e6e2f6c61726176656c2d646f6d61696e732e737667)](https://packagist.org/packages/pushberryfinn/laravel-domains)

A Laravel package to manage and create modular domains inside your Laravel app.

Overview
--------

[](#overview)

This package helps you organise your Laravel application by grouping related code (models, controllers, migrations, routes, commands, etc.) into **domains** — self-contained folders under `app/Domains`. Routes, migrations, and commands are automatically discovered and loaded for each domain.

---

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

[](#requirements)

- PHP 8.2 or higher
- Laravel 11.x

---

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

[](#installation)

```
composer require pushberryfinn/laravel-domains
```

Optionally publish the config file:

```
php artisan vendor:publish --tag=laravel-domains-config
```

---

Usage
-----

[](#usage)

### Create a domain

[](#create-a-domain)

```
php artisan domain:make Doctors
```

This creates the following structure under `app/Domains`:

```
app/Domains/
├── DomainsServiceProvider.php   ← created once on first domain
└── Doctors/
    ├── Console/Commands/
    ├── Http/Controllers/
    ├── Http/Requests/
    ├── Models/
    ├── database/migrations/
    └── routes/api.php

```

> **Important:** After running `domain:make` for the first time, register `DomainsServiceProvider` in `bootstrap/providers.php`:
>
> ```
> return [
>     App\Providers\AppServiceProvider::class,
>     App\Domains\DomainsServiceProvider::class,
> ];
> ```

---

### Generate domain resources

[](#generate-domain-resources)

```
# Model
php artisan domain:make-model Doctor --domain=Doctors

# Controller
php artisan domain:make-controller DoctorController --domain=Doctors

# Form Request
php artisan domain:make-request StoreDoctorRequest --domain=Doctors

# Migration
php artisan domain:make-migration create_doctors_table --domain=Doctors

# Artisan command
php artisan domain:make-command SyncDoctors --domain=Doctors
```

---

How it works
------------

[](#how-it-works)

- Every folder inside `app/Domains` is treated as a domain.
- `DomainsServiceProvider` (placed in `app/Domains`) automatically loads each domain's migrations, routes, and console commands.
- Console commands placed in `{Domain}/Console/Commands/` are auto-registered.

---

Facade
------

[](#facade)

You can use the `LaravelDomains` facade to list all registered domains at runtime:

```
use LaravelDomains;

$domains = LaravelDomains::domains(); // ['Doctors', 'Patients', ...]
```

---

License
-------

[](#license)

The MIT License (MIT). See the [LICENSE](LICENSE.md) file for details.

---

Author
------

[](#author)

Atdhe Krasniqi — [GitHub](https://github.com/pushberryfinn)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance61

Regular maintenance activity

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7201b8cd031084769d61afcc0ce16afdd24ac88857869394e8feeb54c61389ae?d=identicon)[pushberryfinn](/maintainers/pushberryfinn)

---

Top Contributors

[![pushberryfinn](https://avatars.githubusercontent.com/u/35373396?v=4)](https://github.com/pushberryfinn "pushberryfinn (7 commits)")

### Embed Badge

![Health badge](/badges/pushberryfinn-laravel-domains/health.svg)

```
[![Health](https://phpackages.com/badges/pushberryfinn-laravel-domains/health.svg)](https://phpackages.com/packages/pushberryfinn-laravel-domains)
```

###  Alternatives

[awcodes/html-faker

A better html faker.

113.8k4](/packages/awcodes-html-faker)

PHPackages © 2026

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