Refresh token is called when the token has expired based on the expiry time. In order to refresh the token, we also need to add the following route:
$api->patch( '/', [ 'uses' => 'Auth/AuthController@refreshToken', 'as' => 'api.auth.refresh' ]);
Note that all these endpoints will be added under version v1.
Once we have this AuthController there and routes are set up, the user can log in using the following endpoint:
POST /api/v1/auth/loginParams: email, passsword
Try this and you will get a JWT-based access token.