saloonphp / barstool
A Laravel package for logging Saloon Requests & Response.
Requires
- php: ^8.3|^8.4
- illuminate/contracts: ^12.0 | ^13.0
- saloonphp/saloon: ^4.0
- spatie/laravel-package-tools: ^1.16.4
Requires (Dev)
- larastan/larastan: ^3.1.0
- laravel/pint: ^1.20.0
- nunomaduro/collision: ^8.6.1
- orchestra/testbench: ^10.0 | ^11.0
- pestphp/pest: ^4.4.1
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.1
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- spatie/laravel-ray: ^1.39.0
README
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!
Installation
You can install the package via composer:
composer require saloonphp/barstool
You can publish and run the migrations with:
php artisan vendor:publish --tag="barstool-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="barstool-config"
You should also set up Laravel Model Pruning in your scheduler. Please check the Laravel Documentation for your version to know where to put the code below.
use Saloon\Barstool\Models\Barstool; Schedule::command('model:prune', [ '--model' => [Barstool::class], ])->daily();
Usage
That's all folks! Once installed, it will start logging your Saloon requests automatically. Check the config out for more control.
Here are some of the things you can see with Barstool:
- Request Method
- Connector Used
- Request Used
- Request URL
- Request Headers
- Request Body
- Response Status Code
- Response Headers
- Response Body
- Response Duration
The logging 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!
Testing
composer test
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 barstool@craigpotter.co.uk instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
