LaSh stands for Laravel Shop. This is a test application with several API RESTful methods.
- Latest composer
- PHP >= 7.1.3
- MySQL >= 5.6
- Copy
.env.examplefile to.env:
cp ./.env.example ./.env
- Fill out parameters in
.envfile - Install vendor libraries with composer:
composer install
- Run tests:
./vendor/bin/phpunit
- Execute migrations:
php artisan migrate
Important notice! API allows only JSON requests. Therefore all requests must contain a header Accept: application/json.
Description: Creates new product. Returns UUID for created project ID.
Restrictions: Product must have unique type, color and size.
Parameters:
-
price*:
type: float
-
product_type*:
type: string
Max length: 255
-
size*:
type: string
Possible values: xs,s,m,l,xl,xxl,xxxl,xxxxl
-
color*:
type: string
Max length: 30
Description: Creates new order draft from set of products with given quantities. Return total price of the order. Restrictions: total order sum must be greater than or equal to 10.
-
products*:
type: array Where key is product UUID, and value is quantity
Description: Returns list of all orders with their products.
Description: Returns list of orders containing given product type.