https://github.com/connor11528/sample-api
Sample API with Laravel 8
https://github.com/connor11528/sample-api
Last synced: 11 months ago
JSON representation
Sample API with Laravel 8
- Host: GitHub
- URL: https://github.com/connor11528/sample-api
- Owner: connor11528
- Created: 2021-03-01T01:47:56.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-03-01T04:54:09.000Z (almost 5 years ago)
- Last Synced: 2025-01-05T13:24:52.486Z (about 1 year ago)
- Language: PHP
- Homepage: https://epiclaravel.dev/build-and-test-a-laravel-8-api/
- Size: 88.9 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Capybara API
This is a sample API designed to record capybara observations. More notes about setting this project up are [available here](https://epiclaravel.dev/build-and-test-a-laravel-8-api/).
## Getting started
This codebase is set up with Laravel 8 and Laravel Sail for local development using Docker. Follow these steps to get started :)
- Clone repo and start Docker Desktop
- Run `vendor/bin/sail up` to start the Docker containers for PHP server, MySQL and Redis
- Run database seeder to add the acceptable locations to the locations table: `sail php artisan db:seed`
## Run tests
```
sail test
```
## Available endpoints
Right now this API has two endpoints for storing Capybaras and for storing Observations of Capybaras.
```
POST /api/capybaras - accepts name, color and size parameters
POST /api/observations - accepts capybara_name, sighting_date, location_name and wearing_hat parameters
```
## Areas for improvement
- We could add users table and authentication using Laravel Sanctum
- Add support for listing all observations of a Capybara
- Add support for all observations within a given location
- Add geolocation filtering to match observation to closest city location