for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace WagnerMontanini\ApiNfeFasa;
/**
* Class Me
* @package WagnerMontanini\ApiNfeFasa
*/
class Me extends ApiNfeFasa
{
private $headers;
public $token;
* Me constructor
* @param string $apiUrl
public function __construct(string $apiUrl)
parent::__construct($apiUrl);
$this->token = null;
}
* @return Me
public function register(array $fields): Me
$this->request(
"POST",
"/auth/register",
$fields
);
return $this;
public function me(): Me
"GET",
"/auth/me",
null,
$this->headers
public function auth(string $email, string $password): Me
"/auth/token",
array("email" => $email, "password" => $password)
$this->token();
public function logout(): Me
"/auth/logout",
public function token(): Me
if( !empty($this->response()->token) ){
$this->token = $this->response()->token;
$this->headers = array("Authorization"=>"Bearer {$this->response()->token}");