Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```