Adds Action Domain Responder pattern to Laravel 5.6 and above.
This package turns your new Laravel 5.6.* installation into a full ADR application complete with generators, custom homepage, and authentication scaffolding.
You can learn more about ADR and why we think it's far superior to MVC at the ADR repository.
You can also use the pre-built version of Laravail at: Laravail.com
This package is for new installations of Laravel only, installing this into an existing application will destroy all your previous work.
YOU'VE BEEN WARNED!
Laravail will completely remove your existing
app directory and replace it with a beautifully designed ADR directory structure that makes it drop dead simple to understand and locate your files, all while keeping the principles of ADR intact.
The beginning scaffolding will give you a structure like this:
app ├── Actions │ ├── Account │ │ ├── SettingEditAction.php │ │ └── SettingUpdateAction.php │ ├── Auth │ │ ├── LoginShowAction.php │ │ ├── LoginStoreAction.php │ │ ├── LogoutAction.php │ │ └── ... │ ├── Dashboard │ │ └── IndexAction.php │ └── IndexAction.php ├── Domain │ ├── Console │ ├── Contracts │ ├── Entities │ ├── Exceptions │ ├── Middleware │ ├── Payloads │ ├── Providers │ ├── Repositories │ ├── Requests │ ├── Services │ ├── Traits │ └── Kernel.php └── Responders ├── Account ├── Auth └── Dashboard └── IndexResponder.php
We didn't expand all the directories for the sake of brevity, but you can see the idea here.
All of your business logic now exists ONLY within your Domain directory, which allows for clean Separation of Concerns delegating all HTTP related tasks to your Action, and all HTTP Response tasks to your Responders.
No more muddy controllers doing far more work than they should be.
First install a new laravel installation in your Code directory or wherever you keep your dev apps.
laravel new web
Once Laravel is installed we need to generate a key, and we'll link our storage directory since we need that support later.
cd web php artisan key:generate php artisan storage:link
Next let's download Laravail ADR.
composer require laravail/adr
Make sure that the
laravail/adr service provider is discovered in the package auto-discovery message.
Now let's install ADR.
php artisan adr:install
You should now see the new directory structure inside of the
app directory, and all the needed files have had path and namespace changes implemented where needed.
Next let's install our assets and resources.
npm run dev
You should now be able to view the default site in homestead or valet, or boot up a local server via
php artisan serve and view the app at
Coming soon ...