You are able to
- Get the list of all clients
- Get one specific client
- Get all contracts specific to one client
- Update a contract
I used a boiler plate to create the environment for the project. Docker + Lumen with Nginx and MySQL.
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
POST http:https://localhost:80/api/v1/clients
PUT http:https://localhost:80/api/v1/clients
DELETE http:https://localhost:80/api/v1/clients/{client_id}
GET http:https://localhost:80/api/v1/clients
GET http:https://localhost:80/api/v1/clients/{client_id}
POST http:https://localhost:80/api/v1/clients/{client_id}/contrats
PUT http:https://localhost:80/api/v1/clients{client_id}/contrats/{contrat_id}
DELETE http:https://localhost:80/api/v1/clients/{client_id}/contrats/{contrat_id}
GET http:https://localhost:80/api/v1/contrats
GET http:https://localhost:80/api/v1/contrats/{contrat_id}
GET http:https://localhost:80/api/v1/clients/{client_id}/contrats
GET http:https://localhost:80/api/v1/clients/{client_id}/contrats/{contrat_id}