A simple API Product with CRUD function and JWT auth.
This API developed with PHP 8.0, Lumen Framework 9.0
Before you running the program, make sure you've run this command:
composer install
orcomposer update
- Rename
.env.example
to.env
- Generate the jwt secret key with
php artisan jwt:secret
- Create your own database, and put the credential in env file
- Run the migration with
php artisan migrate
- Run db seeder with
php artisan db:seed --class=UsersTableSeeder
php -S localhost:8000 -t public
The program will run on http://localhost:8000
- email: demo@mail.com
- password: demo
Method | URL | Description |
---|---|---|
POST | localhost:8000/login | Login User |
POST | localhost:8000/logout | Logout User |
GET | localhost:8000/product | Get All Product |
POST | localhost:8000/product | Create & Update Product (Add 'id' params in request body for the update function) |
GET | localhost:8000/product/{id} | Get Detail a Product |
DELETE | localhost:8000/product/{id} | Delete a Product |