Independent core layer pattern implementation with Laravel
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
app
bootstrap
config
database
docker
packages/Acme
public
resources
routes
storage
tests
.env.example
.gitattributes
.gitignore
LICENSE
Makefile
artisan
composer.json
composer.lock
docker-compose.yml
package.json
phpunit.xml
readme.md
ruleset.xml
server.php
webpack.mix.js

readme.md

Independent core layer pattern with Laravel

CircleCI

independent-core-layer-pattern

blog

Requirements

  • Docker ( I tested on Docker for Mac. )
  • docker-compose
  • make

Installation

$ git clone this_repo
$ cd this_repo
$ make

If you do not have make command.

$ docker-compose up -d
$ cp .env.example .env
$ chmod -R a+w storage/*
$ docker-compose run composer install --prefer-dist --no-interaction
$ docker-compose exec php-fpm php artisan key:generate
$ docker-compose exec php-fpm php artisan migrate
$ docker-compose exec php-fpm php artisan db:seed

Usage

GetAccount

$ curl -H 'Content-Type: application/json' http://localhost:8000/api/accounts/A00001 | jq .
{
  "account_number": "A00001",
  "balance": 3000
}

TransferMoney

$ curl -X PUT -d '{"destination_number":"B00001","money":100}' -H 'Content-Type: application/json' http://localhost:8000/api/accounts/A00001/transfer | jq .
{
  "balance": 2900
}