Laravel API Project - Dingo Api implementation
- dingo/api configuration
- Clone this repositories
- Install depedencies
$ composer install
- Create .env file
$ cp .env.example .env
- Genereate laravel key
$ php artisan key:generate
- Create API Endpoint using dingo/api with conditions:
- /me : will display biodata, use GET method
- /login : for login process, use POST method
- /register: for register login, use POST method
- /logout: will destroy token, use DELETE method
- Show list of router
$ php artisan api:routes
- Use the postman to check the API that has been made
- Push project to this repositories
- Take a screenshot of your repositories link, postman process/output and then post to the KK4-B Google Classroom
- endpoint /me, access using GET method
{
"status": 200,
"data": {
"name": "Indra Hehe Aja",
"nickname": "goeroeku",
"gender": "Male",
"class": "Pro Akut"
}
}
- endpoint /login and /register, access using POST method
{
"status": 204,
"data": "Success"
}
- endpoint /logout, access using DELETE method
{
"status": 204,
"data": "Success"
}