PHPackages                             salah3id/address-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. salah3id/address-domains

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

salah3id/address-domains
========================

Laravel Domain management

v2.1(2y ago)185MITPHPPHP &gt;=8.2

Since Dec 18Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Salah3id/address-domains)[ Packagist](https://packagist.org/packages/salah3id/address-domains)[ RSS](/packages/salah3id-address-domains/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (8)Versions (21)Used By (0)

Laravel-Domains
===============

[](#laravel-domains)

[![Latest Version on Packagist](https://camo.githubusercontent.com/dab29076c26dfde2da22441b770d9638e01fa655f2b99bbeaa16f62108926ad8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73616c61683369642f616464726573732d646f6d61696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salah3id/address-domains)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Scrutinizer Coverage](https://camo.githubusercontent.com/09a7bbdc06e6ca920a2f84d0ca6ae79f005c80d1f9e62896525401ee4a0f1ef5/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f73616c61683369642f616464726573732d646f6d61696e732e7376673f6d61784167653d3836343030267374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/salah3id/address-domains/?branch=main)[![Quality Score](https://camo.githubusercontent.com/3d0ef92f44548ba1824fc81b3346531729a622be124a61d7c1e519caf037095f/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73616c61683369642f616464726573732d646f6d61696e732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/Salah3id/address-domains)[![Total Downloads](https://camo.githubusercontent.com/af75fca5ac8e2871482300c448320966725f27e2ddfcefb98ba70311c5cea0e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73616c61683369642f616464726573732d646f6d61696e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/salah3id/address-domains)

**Laravel****address-domains**9.0^1.0`salah3id/address-domains` is a Laravel package which created to manage your large Laravel app using domains with repository design pattern to abstract the data layer, making our application more flexible to maintain. Domain is like a Laravel package, it has some views, controllers or models. This package is supported and tested in Laravel 9.

This package is a re-published, re-organised of [nWidart/laravel-modules](https://github.com/nWidart/laravel-modules), which isn't support repository design pattern.

Install
-------

[](#install)

To install through Composer, by run the following command:

```
composer require salah3id/address-domains
```

The package will automatically register a service provider and alias.

Optionally, publish the package's configuration file by running:

```
php artisan vendor:publish --provider="Salah3id\Domains\LaravelDomainsServiceProvider"
```

### Autoloading

[](#autoloading)

By default, the domain classes are not loaded automatically. You can autoload your domains using `psr-4`. For example:

```
{
  "autoload": {
    "psr-4": {
      "App\\": "app/",
      "Domains\\": "Domains/",
      "Database\\Factories\\": "database/factories/",
      "Database\\Seeders\\": "database/seeders/"
  }

}
```

**Tip: don't forget to run `composer dump-autoload` afterwards.**

Creating a Domain
=================

[](#creating-a-domain)

Generate your first domain using :

```
  php artisan domain:make Address
```

The following structure will be generated.

```
app/
bootstrap/
vendor/
Domains/
│   ├── Address/
│   │   ├── Assets/
│   │   ├── Config/
│   │   ├── Console/
│   │   ├── Database/
│   │   │   ├── Migrations/
│   │   │   ├── Seeders/
│   │   ├── Entities/
│   │   ├── Http/
│   │   │   ├── Controllers/
│   │   │   ├── Middleware/
│   │   │   ├── Requests/
│   │   ├── Providers/
│   │   │   ├── AddressServiceProvider.php
│   │   │   ├── RepositoryServiceProvider.php
│   │   │   ├── RouteServiceProvider.php
│   │   ├── Resources/
│   │   │   │   ├── assets/
│   │   │   │   │   ├── js/
│   │   │   │   │   │   ├── app.js
│   │   │   │   │   ├── sass/
│   │   │   │   │   │   ├── app.scss
│   │   │   │   ├── lang/
│   │   │   │   ├── views/
│   │   ├── Routes/
│   │   │   ├── api.php
│   │   │   ├── web.php
│   │   ├── Repositories/
│   │   ├── Tests/
│   │   ├── composer.json
│   │   ├── module.json
│   │   ├── package.json
│   │   ├── webpack.mix.js
│   │   └──
│   └── Other Domains ...
└── ... etc

```

Generate multiple domains using :

```
  php artisan domain:make Address User Admin Blog
```

### `domain:make` command options

[](#domainmake-command-options)

ParameterDescription`--plain` , `-p`By default when you create a new domain, the command will add some resources like a controller, seed class, service provider, etc. automatically. If you don't want these, you can add --plain flag, to generate a plain domain.### Naming convention

[](#naming-convention)

Because we are autoloading the modules using [psr-4](http://www.php-fig.org/psr/psr-4/), we strongly recommend using StudlyCase convention.

Utility commands
----------------

[](#utility-commands)

### domain:make

[](#domainmake)

Generate a new domain

```
  php artisan domain:make Address
```

### domain:make

[](#domainmake-1)

Generate multiple domains at once.

```
  php artisan domain:make Address User Admin
```

### domain:use

[](#domainuse)

This allows you to not specify the doamin name on other commands requiring the module name as an argument.

```
  php artisan domain:use Address
```

### domain:unuse

[](#domainunuse)

This unsets the specified domain that was set with the `domain:use` command.

```
  php artisan domain:unuse Address
```

### domain:list

[](#domainlist)

List all available domains.

```
  php artisan domain:list
```

### domain:migrate

[](#domainmigrate)

Migrate the given domain, or without a domain an argument, migrate all domains.

```
  php artisan domain:migrate Address
```

### domain:migrate-rollback

[](#domainmigrate-rollback)

Rollback the given domain, or without an argument, rollback all domains.

```
  php artisan domain:migrate-rollback Address
```

### domain:migrate-refresh

[](#domainmigrate-refresh)

Refresh the migration for the given module, or without a specified module refresh all modules migrations.

```
  php artisan domain:migrate-refresh Address
```

### domain:migrate-reset

[](#domainmigrate-reset)

Reset the migration for the given domain, or without a specified domain reset all domains migrations.

```
php artisan domain:migrate-reset Address
```

### domain:seed

[](#domainseed)

Seed the given domain, or without an argument, seed all domains

```
php artisan domain:seed Address
```

### domain:publish-migration

[](#domainpublish-migration)

Publish the migration files for the given domain, or without an argument publish all domains migrations.

```
php artisan domain:publish-migration Address
```

### domain:publish-config

[](#domainpublish-config)

Publish the given domain configuration files, or without an argument publish all domains configuration files.

```
php artisan domain:publish-config Address
```

### domain:publish-translation

[](#domainpublish-translation)

Publish the translation files for the given domain, or without a specified domain publish all domains migrations.

```
php artisan domain:publish-translation Address
```

### domain:enable

[](#domainenable)

Enable the given domain.

```
php artisan domain:enable Address
```

### domain:disable

[](#domaindisable)

Disable the given domain.

```
php artisan domain:disable Address
```

### domain:update

[](#domainupdate)

Update the given domain.

```
php artisan module:update Blog
```

Credits
-------

[](#credits)

- [Nicolas Widart](https://github.com/salah3id)
- [David Carr](https://github.com/dcAddressdev)
- [gravitano](https://github.com/gravitano)
- [Anderson Andrade](https://github.com/andersao)
- [Salah Eid](https://github.com/salah3id)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~86 days

Total

17

Last Release

782d ago

Major Versions

v1.2.4 → v2.12024-05-14

PHP version history (2 changes)v1.0.0PHP &gt;=8.0

v2.1PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/57b8f3dea03f6d483ca946917cdb941416510a112f24efdb318657c6ca966a1f?d=identicon)[salah3id](/maintainers/salah3id)

---

Top Contributors

[![Salah3id](https://avatars.githubusercontent.com/u/44832634?v=4)](https://github.com/Salah3id "Salah3id (25 commits)")

---

Tags

laravelrepositorydomaindomainssalah3id

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/salah3id-address-domains/health.svg)

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

###  Alternatives

[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.4k](/packages/typicms-base)[thejano/laravel-domain-driven-design

Helps to use domain driven design within laravel

15425.2k](/packages/thejano-laravel-domain-driven-design)[amin3520/anar

:description

272.3k](/packages/amin3520-anar)[mckenziearts/laravel-command

A simple Laravel package to provide artisan new commands

321.2k](/packages/mckenziearts-laravel-command)

PHPackages © 2026

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