maximebeaudoin / laravel-api-example

Simple api in Laravel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel API example

CircleCI

What this example contains

  1. Api endpoints
  2. CRUD operations using services
  3. Domain Driven application structure with entity and repositories
  4. Unit testing with phpunit
  5. Acceptance testing with behat
  6. Laravel Sanctum integration for authentication
  7. Application policies to check user permissions
  8. Code quality control using tools like CodeSniffer
  9. CircleCi integration for running test and code quality control
  10. Docker compose for easy application setup
  11. Composer helpful scripts

Quick runtime environment to test the api

For convinience, we provide a docker-compose.yml file to quickly start a working environment. The file include php-fpm, nginx and a mysql` database.

Note : The application will run on http://localhost:8000. If you want yo change the port, simply edit the docker-compose.yml file at the root of the project.

Environment variables

The first step is to copy the .env.example file to .env. The example file is already configure to work with the docker-compose.yml configurations.

Commands to start the environment

## Launch containers
docker-compose up

## Migrate the dabase
docker-compose exec php  php artisan migrate:fresh
docker-compose exec php  php artisan db:seed

## Voilà !

About

Simple api in Laravel


Languages

Language:PHP 95.8%Language:HTML 2.3%Language:Gherkin 1.8%Language:Dockerfile 0.1%