Membuat api rental mobil dengan menggunakan framework Laravel
Package yang digunakan:
- Laravel Passport
Register User
Endpoint untuk registrasi user.
-
URL /api/v1/user/register
-
Method:
POST
-
Request Body name
*required
email*required
mobile_phone*required
address*required
role_id*required
password*required
password_confirmation*required
-
Success Response:
- Code: 201 Created
Content:{ "message": "Successfully register" }
- Code: 201 Created
-
Error Response:
- Code: 400 Bad Request
Content:{ "message" : {"email": ["The email has already been taken."]} }
OR
- Code: 400 Bad Request
Content:{ "message" : {"address": ["The address field is required."]} }
- Code: 400 Bad Request
How to run this app on your local?
- After clone this repo
- Run this on your terminal
1. composer install 2. cp .env.example .env 3. change the db config based on your own db 4. php artisan key:generate 5. php artisan passport:install