Skip to content

Commit 3c53780

Browse files
authored
Use Laravel ULID for key (#1738)
1 parent 006dc40 commit 3c53780

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

Diff for: src/LaravelDebugbar.php

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use Barryvdh\Debugbar\Storage\SocketStorage;
2121
use Barryvdh\Debugbar\Storage\FilesystemStorage;
2222
use Barryvdh\Debugbar\Support\Clockwork\ClockworkCollector;
23+
use Barryvdh\Debugbar\Support\RequestIdGenerator;
2324
use DebugBar\Bridge\MonologCollector;
2425
use DebugBar\Bridge\Symfony\SymfonyMailCollector;
2526
use DebugBar\DataCollector\ConfigCollector;
@@ -118,6 +119,7 @@ public function __construct($app = null)
118119
if ($this->is_lumen) {
119120
$this->version = Str::betweenFirst($app->version(), '(', ')');
120121
}
122+
$this->setRequestIdGenerator(new RequestIdGenerator());
121123
}
122124

123125
/**

Diff for: src/Support/RequestIdGenerator.php

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?php
2+
3+
namespace Barryvdh\Debugbar\Support;
4+
5+
use DebugBar\RequestIdGeneratorInterface;
6+
use Illuminate\Support\Str;
7+
8+
class RequestIdGenerator implements RequestIdGeneratorInterface
9+
{
10+
public function generate(): string
11+
{
12+
return (string) Str::ulid();
13+
}
14+
}

0 commit comments

Comments
 (0)