Skip to content

Commit 563aa44

Browse files
authored
Merge pull request #11 from A909M/fix-missing-attribute
2 parents 50f837b + 86616ac commit 563aa44

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/Support/ActivityLogTitle.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ public static function get(mixed $model): string
1919
return $model->getActivityLogTitle();
2020
}
2121

22-
if ($title = $model->getAttribute('name')) {
23-
return (string) $title;
22+
if ($model->hasAttribute('name')) {
23+
return (string) $model->getAttribute('name');
2424
}
2525

26-
if ($title = $model->getAttribute('title')) {
27-
return (string) $title;
26+
if ($model->hasAttribute('title')) {
27+
return (string) $model->getAttribute('title');
2828
}
2929

30-
if ($title = $model->getAttribute('email')) {
31-
return (string) $title;
30+
if ($model->hasAttribute('email')) {
31+
return (string) $model->getAttribute('email');
3232
}
3333

34-
if ($title = $model->getAttribute('username')) {
35-
return (string) $title;
34+
if ($model->hasAttribute('username')) {
35+
return (string) $model->getAttribute('username');
3636
}
3737

3838
return class_basename($model).' #'.$model->getKey();

0 commit comments

Comments
 (0)