vendredi 26 août 2016

Where to put things in Laravel 5.1

I'm a bit confused about where something like this belongs to Laravel.

I want to write a web service client wrapper in laravel, and I want to access it like this:

\MyWSClient::getSomeInfoAbout($someId);

then the code will connect to the web service to http://ift.tt/2bFLpsC$someid&type=json with OAuth2 or some token requests, then fetch the data, keep token information until it expires, refresh token if needed etc.

But where will I put the code? In the vendor directory as a new package? I'm moving this code from a computer to another computer except vendor,storage and node_modules folders, because they are huge and when I do this, I will have to move only one folder in the vendor directory. And I'll need to publish a package under development to composer if I want portability etc.

Is there any other way to do something like this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire