This is a very basic REST API built in Laravel PHP framework. It uses JWT auth for authenticated requests.
- PHP
>= 7.1.3 - MySQL
>= 5.6
- Clone the repo (
git clone...) - Run
composer installto install the application dependencies - Create a copy of
.env.exampleand save it as.env - Create a database and enter the database credentials in the
.envfile - Run
php artisan migrateto create the database tables
Simply make a request to an endpoint listed below (you should include an Accept header with the value application/json with your request).
In order to call these endponts, you will need to send an authorization header along with your request.
To get your token, simply login at /api/user/login (or create an account at /api/user/register). Then include the returned access token as a Bearer token in your request.
- GET
/api/products(get all products) - GET
/api/products/{id}(get a single product) - POST
/api/products(create a product) - PUT
/api/products/{id}(edit a product) - DELETE
/api/products/{id}(delete a product)
Appropriate feedback / validation is provided in case of errors, etc.