Download the PHP package shetabit/extractor without Composer

On this page you can find all versions of the php package shetabit/extractor. 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 extractor

Laravel Extractor

Latest Version on Packagist Total Downloads on Packagist Tests Code Style Static Analysis Code Coverage

Communicate with remote servers or microservices in an easy way.

All requests and responses can be cached and manipulated on runtime using middlewares.

This package requires PHP 8.4+ and supports Laravel 12+.

Donate me if you like this package :sunglasses: :bowtie:

List of contents

Install

Via Composer

The service provider is registered by Laravel's package discovery, so there is nothing to add to config/app.php (or to bootstrap/providers.php).

How to use

Send requests

you can send requests to remote API using Request class, see the below example:

as you see, you can work with remote API in an easy way.

the Request has more methods to add fields, headers and etc.

Send concurrent requests

you can send concurrent requests like the below

Event listeners

you can set success and error listener for each requests seperately. here is another example that uses onSuccess and onError listeners.

Middlewares

How to create

Middlewares can be created by running the below command

The former command will create a middleware named test in app\Http\RemoteRequests\Middlewares path.

You can add a middleware to request like the below:

Multiple middlewares can be used by calling middleware method multiple times:

Each middleware has a handle method that can be used to handle requests and responses.

The following middleware would perform some task before the request is handled by the application:

However, this middleware would perform its task after the request is handled by the application:

A middleware can also answer on its own, without letting the request through — return a ResponseInterface instead of calling $next. Answering with null ends the request in a RuntimeException, since there is no response to hand back.

Global middlewares

You can use Request::withGlobalMiddlewares to add global middlewares. global middlewares will be binded to all requests.

in each request, you can unbind global middlewares, if you need them just use withoutMiddleware like the below:

Cache

you can cache responses according to requests.

Notice: TTL (Time To Live) is the same as Laravel cache.

Conditional configs

Sometimes you need to add some configs when a condition happens, in this kind of situations you can use the when method to add conditional configs.

Client

You can encapsulate any request that exists between the current microservice and the remote microservice within a Client.

Create clients

Clients can be created using a simple command

Clients will saved in app/Http/RemoteRequests/Clients by default.

lets create and example, imagine you have and remote Api (or microservice) and need to login into it.

then, your Login micro-client can be similar to below codes:

Run a client

you can run the Login micro-client like the below (we have Login client example at the top)

as you see, client starts to work as you call the run method, fetches and returns a response.

On progress features

Testing

Every pull request and every push to master is checked by GitHub Actions: the test suite runs on PHP 8.4 and 8.5, against Laravel 12 and 13 and against both the lowest and the highest supported dependencies, the coding style is checked with PHP_CodeSniffer, the sources are analysed with PHPStan (level 7, with larastan) and the code coverage of the test suite is measured and has to stay above 95%.

The suite has two parts: tests/Unit covers the classes of the package on their own, and tests/Feature sends real requests over a real connection to a stub server the suite starts (tests/Support/StubServer.php), which answers with an echo of the request it received.

You can run the same checks locally. With PHP and Composer installed on your machine:

If you would rather not install PHP on your machine, the shipped Dockerfile and Makefile run everything inside a container:

Another PHP version can be used with make test PHP_VERSION=8.5, and a single Laravel version with make test-laravel LARAVEL=12.

Change log

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

Contributing

Please see CONDUCT for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

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


All versions of extractor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
guzzlehttp/guzzle Version ^7.8.2|^8.0
illuminate/console Version ^12.0|^13.0
illuminate/support Version ^12.0|^13.0
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 shetabit/extractor contains the following files

Loading the files please wait ...