Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/supplycart/domains
A simple package to set up domains for Laravel application
https://github.com/supplycart/domains
domain-driven-design hacktoberfest laravel
Last synced: 26 days ago
JSON representation
A simple package to set up domains for Laravel application
- Host: GitHub
- URL: https://github.com/supplycart/domains
- Owner: supplycart
- Created: 2020-09-24T06:53:27.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-02-07T05:12:21.000Z (almost 3 years ago)
- Last Synced: 2024-11-25T11:46:40.806Z (28 days ago)
- Topics: domain-driven-design, hacktoberfest, laravel
- Language: PHP
- Homepage:
- Size: 229 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Laravel Domains
A simple package to set up domains for your applications.
### Installation
To install through composer, run the following command from terminal:
```php
composer require supplycart/domains
```Then publish config using:
```php
php artisan vendor:publish
```### Usage
You can set up a domain by creating a domain class which extends `Supplycart\Domains\Domain` and register it inside `domains.php` config file like this:
```php
[
App\Domains\User\UserDomain::class
]
];
```The folder structure suggested is as below:
```
app/
- Domains/
- User/
- Http/
- Controllers/
- routes.php # all routes in here
- Models/
- Policies/
- UserDomain.php # your domain class
- Cart
...
- Order
...
```Command to populate domain folder
```php
php artisan make:domain DomainName
```To populate events, listeners and jobs you may pass in the `--queues` argument.
```php
php artisan make:domain DomainName --queues
```