Fit to scale?
💪🏻 Pros
👎🏻 Cons
=> What would I do differently?
Great to maintain abstraction and flexibility but...
=> Failure for synchronus micro-services
Still cool for asynchrous ms, replacing the HTTP Layer by a Redis Queue
---| app
| domain
| bootstrap
| config
| public
| tests
| storage
| vendor
| (database)
| (resources)
---| app
| domain
| bootstrap
| config
| public
| tests
| storage
| vendor
| (database)
| (resources)
domain -| TaskManagement -| Models
| Requests
| Jobs
| Subscribers
| Policies
| Mailables
| Expose -| API -| Transformers
-| Controllers
routes.php
-| Web -| Views
-| Controllers
routes.php
-| CLI -| Commands
-| Resources -| Mails
-| Middlewares
-| Langs
| storage
| vendor
composer.json
-| BusinessLogic2 -| ...
Each directory gets a composer.json
+ namespace LuckeyHomes/BusinessLogic
to be switched to a package easily
{
"require": {
"wikimedia/composer-merge-plugin": "dev-master",
"twilio/sdk": "^4.5",
"algolia/algoliasearch-laravel": "^1.0",
"intercom/intercom-php": "^3.0"
},
"scripts": {
"post-install-cmd": "./scripts/composer-post-install.sh",
"production-warmup": [
"php artisan config:cache",
"php artisan route:cache"
]
},
"extra": {
"merge-plugin": {
"include": [
"domain/*/composer.json"
],
"require": [
"submodule/composer.json"
],
"recurse": true,
"replace": true,
"merge-dev": true,
"merge-extra": true,
"merge-scripts": true
}
}
}
From Laravel 5.4: loadMigrationsFrom
FIG=docker-compose
EXEC=exec --user=laradock workspace sh
EXECB=exec --user=laradock workspace bash
.PHONY: test
test:
cp .env .env.backup
cp .env.travis .env
$(FIG) up -d
@(if [ "$(filter-out $@,$(MAKECMDGOALS))" = "" ]; \
then $(FIG) $(EXEC) -c "vendor/bin/codecept run -f"; \
else $(FIG) $(EXEC) -c "vendor/bin/codecept run -f domain/$(filter-out $@,$(MAKECMDGOALS))/tests/ -f"; fi)
$(FIG) stop
mv .env.backup .env