Project using PHP 8.3 / SQLite
- Run
composer install. - Run
php artisan env:decrypt --key=73MIC0ayRQMduuF4wYpKDNzu8vUWQmgO - Run
php artisan migrate:fresh --seed - Run
php artisan serve - Open
http://127.0.0.1:8000in your browser
API Endpoint: http://127.0.0.1:8000/api
Please add
Accept: application/jsonheader to all your requests
Cart routes requires authentication, so please get token via "Login" route first
Method: POST
URL: http://127.0.0.1:8000/api/login
Payload:
{
"email": "user@test.com",
"password": "password"
}Use token from response to all auth routes. Add header Authorization: Bearer $token
Method: GET
URL: http://127.0.0.1:8000/api/products
Method: GET
URL: http://127.0.0.1:8000/api/cart
Method: POST
URL: http://127.0.0.1:8000/api/cart-items
Payload:
{
"product_id": 1
}Method: DELETE
URL: http://127.0.0.1:8000/api/cart-items/{item_id}
Where item_id is items.*.id from Get Cart request