sil2/vidflex

FidFlex API Test

v1.0.2 2021-12-08 19:29 UTC

This package is auto-updated.

Last update: 2024-05-09 00:44:30 UTC


README

Requirements

  • Laravel ^8.0
  • PHP ^8.0

Installation

Install Laravel

add composer package

composer require sil2/vidflex

Configure DB connection in .env file

DB_CONNECTION=mysql
DB_HOST=
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

run to create tables:

php artisan migrate

run to seed test data

php artisan db:seed --class="Sil2\Vidflex\Database\Seeds\VidflexSeeder"

Start the server

php artisan serve

API

Auth Token

POST /token/create?email=test@test.com&password=test

use test user or any valid user email & password to get the token

API commands

All API requests must contains a valid Bearer token in the headers

Example:

curl --location --request GET 'http://vidflex.local/api/order/1' \
--header 'Authorization: Bearer #########'

To add products to the cart

POST /api/cart/products/{product-id}

To retrieve a list of products in the cart

GET /api/cart

To create an order from the cart

POST /api/order

To retrieve a list of products in the order

GET /api/order/{order-id}