Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add ability to supply X-Barstool-UUID in a request header#6

Open
allmanaj wants to merge 2 commits into
saloonphp:main from
allmanaj:pass-in-x-barstool-uuid
Open

Add ability to supply X-Barstool-UUID in a request header #6
allmanaj wants to merge 2 commits into
saloonphp:main from
allmanaj:pass-in-x-barstool-uuid

Conversation

@allmanaj

@allmanaj allmanaj commented May 13, 2026
edited
Loading

Copy link
Copy Markdown

Overview of change

This PR adds the ability to send your own custom X-Barstool-UUID in the header of a Saloon request and to have that be the UUID stored against the row in the barstools table.

Reasoning

I have started using Barstool at work to provide visibility of our requests since the codebase relies heavily on calls to external APIs. Barstool is ideal for this, but we have an instance where we want to store more specific data about a certain repeated job and how to connects to other models in our codebase. By checking for the existence of the X-Barstool-UUID header before the package generates a new UUID, it allows us to supply a UUID from our codebase which can be stored on the more detailed log model. This allows us to associate our own log with the barstool record without clogging up the barstools table.

Example Implementation

$barstoolId = Str::uuid();
$request = new RequestWhichAcceptsCustomHeaders(headers: ['X-Barstool-UUID' => $barstoolId]);
$response = $request->send();
if($response->failed()) {
 LogModelWithAddedContext::create([
 'user_id' => auth()->id,
 'barstool_id' => $barstoolId,
 ]);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /