Skip to content

shin1x1/independent-core-layer-laravel

Repository files navigation

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
}

About

Independent core layer pattern implementation with Laravel

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages