Download the PHP package salah3id/address-domains without Composer
On this page you can find all versions of the php package salah3id/address-domains. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package address-domains
Laravel-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, which isn't support repository design pattern.
Install
To install through Composer, by run the following command:
The package will automatically register a service provider and alias.
Optionally, publish the package's configuration file by running:
Autoloading
By default, the domain classes are not loaded automatically. You can autoload your domains using psr-4. For example:
Tip: don't forget to run composer dump-autoload afterwards.
Creating a Domain
Generate your first domain using :
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 :
domain:make command options
| Parameter | Description |
|---|---|
--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
Because we are autoloading the modules using psr-4, we strongly recommend using StudlyCase convention.
Utility commands
domain:make
Generate a new domain
domain:make
Generate multiple domains at once.
domain:use
This allows you to not specify the doamin name on other commands requiring the module name as an argument.
domain:unuse
This unsets the specified domain that was set with the domain:use command.
domain:list
List all available domains.
domain:migrate
Migrate the given domain, or without a domain an argument, migrate all domains.
domain:migrate-rollback
Rollback the given domain, or without an argument, rollback all domains.
domain:migrate-refresh
Refresh the migration for the given module, or without a specified module refresh all modules migrations.
domain:migrate-reset
Reset the migration for the given domain, or without a specified domain reset all domains migrations.
domain:seed
Seed the given domain, or without an argument, seed all domains
domain:publish-migration
Publish the migration files for the given domain, or without an argument publish all domains migrations.
domain:publish-config
Publish the given domain configuration files, or without an argument publish all domains configuration files.
domain:publish-translation
Publish the translation files for the given domain, or without a specified domain publish all domains migrations.
domain:enable
Enable the given domain.
domain:disable
Disable the given domain.
domain:update
Update the given domain.
Credits
- Nicolas Widart
- David Carr
- gravitano
- Anderson Andrade
- Salah Eid
- All Contributors
License
The MIT License (MIT). Please see License File for more information.