daalvand / api-requirements

Api Requirements.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

api-requirements

run & installation

  1. Copy .env.example to .env cp .env.example .env, then change default values. For getting UID and GID, run the following commands.
    id -u #UID
    id -g #GID
  1. Copy src/.env.example to src/.env cp src/.env.example src/.env (you can change default values)

  2. Run this command to install the dependencies:

    docker-compose run --user=$(id -u) --rm app composer install
  1. Generate the key:
    docker-compose run --user=$(id -u) --rm app php artisan key:generate
  1. Run migrations:
    docker-compose run --user=$(id -u) --rm app php artisan migration --seed
  1. Use the following command to launch the project:
    docker-compose up --build -d

usage

api filters:

  • category: /api/v1/products?category=insurance
  • price: /api/v1/products?price=99000
  • price range: /api/v1/products?price_range[min]=10000&price_range[max]=90000
  • pagination: /api/v1/products?page=1&per_page=12

NOTE: Use Accept:application/json header if you want see errors and so on

About

Api Requirements.


Languages

Language:PHP 97.8%Language:Blade 2.0%Language:Shell 0.1%Language:Dockerfile 0.0%Language:JavaScript 0.0%