| Body | Payload | Verb | |
|---|---|---|---|
| Register | /api/auth/register | name, email, password, password_confirmation | POST |
| Login | /api/auth/login | email, password | POST |
| Logout | /api/auth/logout | token | POST |
| Refresh | /api/auth/refresh | token | POST |
| Endpoint | Body | Verb | |
|---|---|---|---|
| Index | /api/addresses | token, ?per_page | GET |
| Show | /api/addresses/{id} | token | GET |
| Store | /api/addresses | token, cep, house_number, reference_point | POST |
| Update | /api/addresses/{id} | token, ?fields to be updated | PUT |
| Destroy | /api/addresses/{id} | token | DELETE |
(Are you in a hurry? Run the installation script with: ./install.sh)
- Clone project:
$ git clone https://github.com/henri1i/address-api.git
$ cd address-api- Install dependencies:
$ composer install- Setting up env
$ cp .env.example .env- Start the application
$ sail up -d- Generate env variables
$ php artisan key:generate
$ php artisan jwt:secret- Run the migrations
$ sail php artisan migrate
$ sail php artisan db:seed #Just if you want to run the seedersEnjoy!