Download the PHP package saloonphp/barstool without Composer

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

Barstool

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Barstool is a dedicated Laravel package to help you keep track of your Saloon requests & responses.

Barstool will allow you to easily view, search, and filter your logs directly in your database tool of choice.

The package is designed to be as simple as possible to get up and running, with minimal configuration required.

So pull up a barstool, grab a drink, and let's get logging in the Saloon! Yeehaw!

Requirements

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

Finally, set up pruning in your scheduler so your logs don't grow forever.

Usage

That's all folks! Once installed, Barstool starts logging your Saloon requests automatically. Check the config out for more control.

Here are some of the things you can see with Barstool:

Barstool will even log fatal errors caused by your Saloon requests, so you can see what went wrong.

[!TIP] We will be adding more features soon, so keep an eye out for updates!

Configuration

Everything below lives in config/barstool.php once published.

Enabling & disabling

Barstool is enabled out of the box. To switch it off entirely — no requests recorded — set the env variable:

Handy for local development or test environments where you don't want the noise.

Choosing what gets recorded

By default, Barstool records every Saloon request. You can narrow that down in two directions:

A request is recorded if it matches either only list (or both lists are empty), and the ignore list always takes precedence — so you can allow a whole connector and still ignore individual requests on it.

Keeping only failed responses

If you mainly use Barstool to investigate failures, you can skip storing successful response data:

The request, response status, duration, and outcome are still recorded for successful calls — only the response body and headers are omitted, so your "show me failures" queries stay accurate. Failed responses and fatal errors are always kept in full.

Redacting sensitive request headers

Headers listed in excluded_request_headers are stored with their value replaced by REDACTED. The Authorization header is redacted by default.

When '*' or a connector/request class matches, every header is dropped from the recording except Barstool's own X-Barstool-UUID correlation header.

Header names are matched case-insensitively, so authorization is caught by an Authorization exclusion.

Redacting sensitive response headers

Response headers work the same way via excluded_response_headers — matching values are stored as REDACTED. The Set-Cookie header is redacted by default so session cookies never land in your logs:

Excluding response bodies

Response bodies for sensitive endpoints can be kept out of the database entirely — they are stored as REDACTED:

Response body limits

To keep the table lean, Barstool only stores response bodies that are:

You may also spot a couple of other placeholder values in the barstools table: streamed request/response bodies are stored as <Streamed Body> (reading them would consume the stream before your application gets it), and multipart request bodies as <Multipart Body>.

Database connection

Recordings are stored on your default database connection. To keep them elsewhere — a separate database, or just a different connection — set:

The migration and the Barstool model both respect this connection.

Pruning old recordings

Recordings are kept for 30 days by default, controlled by:

Pruning uses Laravel's model pruning, so you need to schedule it. Please check the Laravel Documentation for your version to know where to put the code below.

Queue support

By default, Barstool writes recordings to the database synchronously. If you'd like to offload this to a queue, you can enable it in the config:

Or simply set BARSTOOL_QUEUE_ENABLED=true in your .env file.

When queue support is enabled, recordings are dispatched as jobs instead of being written inline. Each job is unique (preventing duplicates) and uses idempotent writes (updateOrCreate), so recordings are safe even if a job is retried. Failed jobs will automatically retry up to 3 times with a backoff of 5 and 30 seconds.

Adding context to recordings

Sometimes the request and response alone don't tell the whole story. You can attach your own context to recordings — the current user, tenant, job name, anything you like — and it will be stored in the context column of the barstools table as JSON:

Once set, the context is stored against every request Barstool records until the end of the current request or job. Calling context() again merges the new keys in (overwriting any that already exist), and you can clear everything with Barstool::flushContext().

Under the hood this uses Laravel Context hidden data, which means:

[!IMPORTANT] If you are upgrading from an earlier version of Barstool, publish and run the migrations again to add the new context column:

Barstool only touches the context column when you actually set context, so upgrading the package without running the migration is safe until you start using this feature.

Correlating Barstool records with your own models

If you want a row in one of your own tables to point at a Barstool recording (rather than storing extra data on the recording itself), you can read the recording's UUID straight off the sent request. Barstool adds an X-Barstool-UUID header to every request it records:

Testing

Changelog

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

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

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 barstool with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3|^8.4|^8.5
illuminate/contracts Version ^12.0 | ^13.0
saloonphp/saloon Version ^4.0
spatie/laravel-package-tools Version ^1.16.4
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 saloonphp/barstool contains the following files

Loading the files please wait ...