Download the PHP package juststeveking/laravel-transporter without Composer

On this page you can find all versions of the php package juststeveking/laravel-transporter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-transporter

Transporter

Latest Version on Packagist GitHub Tests Action Status Total Downloads

Transporter is a futuristic way to send API requests in PHP. This is an OOP approach to handle API requests.

![](banner.png)

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:

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 or Concurrent

To fake a request, all you need to do is replace the build method with the fake method, which takes an optional status parameter, to set the status code being returned with the response:

Which will return a response with the data you pass through to withFakeData, which internally will merge what is on the class with what you pass it. So you can build up an initial state of faked data per class.

Sending XML

Thanks to a fantastic suggestion by @jessarcher we can use a Trait to allow for easy use of XML in your requests. Using this as a trait makes a lot of sense as most APIs these days use JSON, so it is purely opt in. To use this, simply use the trait on your request:

Then all you need to do is call the methods:

Testing

To run the tests in parallel:

To run the tests with a coverage report:

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-transporter with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^10.0
juststeveking/http-status-code Version ^2.0
juststeveking/uri-builder Version ^2.0
spatie/laravel-package-tools Version ^1.14.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package juststeveking/laravel-transporter contains the following files

Loading the files please wait ....