Skip to content

Commit 429626b

Browse files
committed
Force push UUID for logs.
1 parent 716ca7d commit 429626b

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

database/migrations/create_laravel_developer_table.php.stub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class CreateLaravelDeveloperTable extends Migration
99
public function up()
1010
{
1111
Schema::create('exception_logs', function (Blueprint $table) {
12+
$table->id();
1213
$table->uuid('uuid');
1314

1415
$table->string('name')->nullable();

src/Models/Concerns/WithUuid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait WithUuid
1010
protected static function bootWithUuid()
1111
{
1212
self::creating(function (Model $model) {
13-
$model->setAttribute('uuid', Str::uuid());
13+
$model->setAttribute('uuid', (string) Str::uuid());
1414
});
1515
}
1616

src/Models/ExceptionLog.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public function getKeyName()
5555
public static function makeFromDevLog(DevLog $log): self
5656
{
5757
return new static([
58+
'uuid' => (string) Str::uuid(),
5859
'name' => $log->name,
5960
'payload' => $log->payload,
6061
]);
@@ -63,6 +64,7 @@ public static function makeFromDevLog(DevLog $log): self
6364
public static function makeFromException(Throwable $throwable, JsonSerializable $payload = null): self
6465
{
6566
return new static([
67+
'uuid' => (string) Str::uuid(),
6668
'name' => Str::substr($throwable->getMessage(), 0, 255),
6769
'file' => $throwable->getFile(),
6870
'line' => $throwable->getLine(),

0 commit comments

Comments
 (0)