Skip to content

lalsdev/restAPI-lumen

Repository files navigation

Rest Api built with Lumen

tables

You are able to

  • Get the list of all clients
  • Get one specific client
  • Get all contracts specific to one client
  • Update a contract

Environment Setup

I used a boiler plate to create the environment for the project. Docker + Lumen with Nginx and MySQL.

How to use

Copy the project

git clone https://github.com/lalsdev/restAPI-lumen

Go in folder

cd restAPI-lumen

Build project

sudo docker-compose up --build -d

Enter the container

sudo docker-compose exec php sh

Exit current folder inside the container

cd ..

Download modules from composer

composer install

You should be able to access the routes

Stop container

sudo docker-compose down

Create client

POST http:https://localhost:80/api/v1/clients

Update one or more attributes from client

PUT http:https://localhost:80/api/v1/clients

Delete

DELETE http:https://localhost:80/api/v1/clients/{client_id}

Get all clients

GET http:https://localhost:80/api/v1/clients

Get one specific client

GET http:https://localhost:80/api/v1/clients/{client_id}

Create contract

POST http:https://localhost:80/api/v1/clients/{client_id}/contrats

Update one or more attributes from contract

PUT http:https://localhost:80/api/v1/clients{client_id}/contrats/{contrat_id}

Delete

DELETE http:https://localhost:80/api/v1/clients/{client_id}/contrats/{contrat_id}

Get all contracts

GET http:https://localhost:80/api/v1/contrats

Get one contract

GET http:https://localhost:80/api/v1/contrats/{contrat_id}

Get all contracts from one client

GET http:https://localhost:80/api/v1/clients/{client_id}/contrats

Get one contract from one client

GET http:https://localhost:80/api/v1/clients/{client_id}/contrats/{contrat_id}

Releases

No releases published

Packages

No packages published