Skip to content

Commit 58ea99e

Browse files
committed
Use id instead of uuid.
1 parent 190bd57 commit 58ea99e

File tree

4 files changed

+7
-17
lines changed

4 files changed

+7
-17
lines changed

config/developer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* The url to the web where you may display the exception.
1111
*
12-
* For instance you can use nova, so the url will look like: /nova/resources/exception-logs/{uuid}
12+
* For instance you can use nova, so the url will look like: /nova/resources/exception-logs/{id}
1313
*
1414
* We will replace the uuid with the exception log uuid.
1515
*/

src/Models/ExceptionLog.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
/**
1717
* Class ExceptionLog
18+
* @property int $id
1819
* @property string $uuid
1920
* @property-read string $identifier
2021
* @property string $name
@@ -38,24 +39,13 @@ class ExceptionLog extends Model
3839

3940
protected $table = 'exception_logs';
4041

41-
protected $primaryKey = 'uuid';
42-
43-
public $incrementing = false;
44-
45-
protected $keyType = 'string';
46-
4742
protected $guarded = [];
4843

4944
protected $casts = [
5045
'payload' => 'array',
5146
'exception' => 'array',
5247
];
5348

54-
public function getKeyName()
55-
{
56-
return 'uuid';
57-
}
58-
5949
public static function makeFromDevLog(DevLog $log): self
6050
{
6151
return new static([
@@ -114,7 +104,7 @@ public function getUrl(): ?string
114104
return null;
115105
}
116106

117-
return Str::replaceArray('{uuid}', ['{uuid}' => $this->uuid,], config('developer.exception_log_base_url'));
107+
return Str::replaceArray('{id}', ['{id}' => $this->id,], config('developer.exception_log_base_url'));
118108
}
119109

120110
public static function prune(DateTimeInterface $before)

tests/Helpers/SlackHelperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function test_slack_helper_can_send_throwable_to_slack()
3535
Notification::fake();
3636

3737
config([
38-
'developer.exception_log_base_url' => 'app.test/{uuid}',
38+
'developer.exception_log_base_url' => 'app.test/{id}',
3939
]);
4040

4141
$this->assertInstanceOf(Slack::class, slack(new Exception('not found', 404))->persist());
@@ -46,7 +46,7 @@ public function test_slack_helper_can_send_throwable_to_slack()
4646
'tags' => 'danger',
4747
]);
4848

49-
$uuid = ExceptionLog::latest()->first()->uuid;
49+
$uuid = ExceptionLog::latest()->first()->id;
5050

5151
Notification::assertSentTo(new AnonymousNotifiable, DevNotification::class, function (DevNotification $class) use ($uuid) {
5252
return $class->notificationDto->attachment_link === "app.test/{$uuid}";

tests/Models/ExceptionLogTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function test_can_serialize_multiple_payloads()
5858
public function test_can_generate_link()
5959
{
6060
config([
61-
'developer.exception_log_base_url' => 'foo/{uuid}',
61+
'developer.exception_log_base_url' => 'foo/{id}',
6262
]);
6363

6464
$log = tap(ExceptionLog::makeFromException(
@@ -69,7 +69,7 @@ public function test_can_generate_link()
6969
});
7070

7171
$this->assertSame(
72-
'foo/' . $log->uuid,
72+
'foo/' . $log->id,
7373
$log->getUrl()
7474
);
7575
}

0 commit comments

Comments
 (0)