{"repo":"JustSteveKing/laravel-transporter","free":true,"listed":false,"github":"https://github.com/JustSteveKing/laravel-transporter","clone":"git clone https://github.com/JustSteveKing/laravel-transporter.git","description":"Transporter is a futuristic way to send API requests in PHP. This is an OOP approach to handling API requests.","language":"PHP","stars":480,"topics":["laravel","api-client","oop","hacktoberfest"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Transporter Transporter is a futuristic way to send API requests in PHP. This is an OOP approach to handle API requests. Installation You can install the package via composer: You can publish the config file with: The contents of the published config file: Generating Request To generate an API request to use with Transporter, you can use the Artisan make command: This will by default publish as: app/Transporter/Requests/NameOfYourRequest.php Usage Transporter Requests are an extention of Laravels PendingRequest so all of the methods available on a Pending Request is available to you on your requests. Also when you send the request, you will receive a Illuminate\\Http\\Client\\Response back, allowing you to do things such as collect($key) and json() and failed() very easily. We are simply just shifting how we send it into a class based approach. When building your request to send, you can override the following: - Request Data using withData(array $data) - Request Query Params using withQuery(array $query) - Request Path using setPath(string $path) Checking the payload I had a request in an issue to be able to see the request data for a request, so I have added a helper method called payload which will return whatever has been stored in the request data property. Concurrent Requests Concurrency with a Custom key Optional Alias Instead of the standard send() method, it is also possible to use the fun alias energize() . Please note, no sound effects are included. Faking a Request o","default_branch":null,"files":null,"tree":[],"storefront":"/r/JustSteveKing","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/JustSteveKing/laravel-transporter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}