Created
August 23, 2019 12:39
-
-
Save erikfig/97f5c6226a25c38651ace38b6f77deb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Client; | |
class Client | |
{ | |
protected $token; | |
protected handler() | |
{ | |
$client = new Client(); | |
$client->request(..., ..., [ | |
'body' => ... | |
]) | |
} | |
public function __call($nome, $attribute) | |
{ | |
$nome = get-contas-a-pagar; | |
$this->url = '/api/' + $nome; | |
$this->handler(); | |
} | |
public function contasAPagarFornecedores() | |
{ | |
$this->url = '...'; | |
$this->handler(); | |
} | |
} | |
app()->bind('App\Client\Client', function ($app) { | |
$client = new App\Client; | |
$client->auth(); | |
return $client; | |
}); | |
$client = app()->make('App\Client\Client'); | |
$client->getContasAPagar('GET', $data) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment