dimanche 29 octobre 2017

Best Location In Laravel For Third-Party API Connection

I'm writing a Laravel application using one or more third-party APIs when it suddenly dawned on me. Where is the best place within the Laravel application structure to setup the API connection in order to consume it from within my Controllers? Would you use a Service or put the logic somewhere else?

$this->api = new RestApi();
    ->setUrl(getenv('API_REST_URL'))
    ->setUsername(getenv('API_USERNAME'))
    ->setPassword(getenv('API_PASSWORD'))
    ->connect();



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2gUN29l
via IFTTT

Aucun commentaire:

Enregistrer un commentaire