- Run
./vendor/bin/sail up -d
to bring up Docker. - Run migrations:
docker-compose run app php artisan migrate
(ideally add to dockerfile) - Seed data:
docker-compose run app php artisan db:seed
You can view the API's in the browser by going to http://localhost/docs.
curl --location 'localhost/api/v1/cars?from_date=2025-04-06%2000%3A00%3A00&to_date=2025-04-06%2000%3A00%3A00&age=55' \
--header 'Accept: application/json'
curl --location 'localhost/api/v1/bookings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"from_date": "2027-01-01 00:00:00",
"to_date": "2027-02-01 00:00:00",
"car_id": 1
}'
curl --location --request PATCH 'localhost/api/v1/bookings/1' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"from_date": "2027-01-01 00:00:00",
"to_date": "2027-02-01 00:00:00",
"car_id": 2
}'
curl --location --request DELETE 'localhost/api/v1/bookings/1'
Run docker-compose run app bin/lint
Run docker-compose run app ./vendor/bin/phpunit
- Feature tests on booking CRUD endpoints
- OAUTH Authentication / User stored on booking
- More user friendly validation errors
- Pipeline / CI / CD
- Caching on bookings (kept fresh using events) / cars
- Has potential to use ElasticSearch, but over-engineering at this point