Fix incorrect API definitions
This commit is contained in:
parent
2a2fc42e37
commit
d1da46c5aa
3 changed files with 13 additions and 2 deletions
|
@ -73,7 +73,12 @@ class ActivityLog extends Model
|
|||
|
||||
public function actor(): MorphTo
|
||||
{
|
||||
return $this->morphTo()->withTrashed();
|
||||
$morph = $this->morphTo();
|
||||
if (method_exists($morph, 'withTrashed')) {
|
||||
return $morph->withTrashed();
|
||||
}
|
||||
|
||||
return $morph;
|
||||
}
|
||||
|
||||
public function subjects()
|
||||
|
|
|
@ -35,6 +35,11 @@ class ActivityLogSubject extends Pivot
|
|||
|
||||
public function subject()
|
||||
{
|
||||
return $this->morphTo()->withTrashed();
|
||||
$morph = $this->morphTo();
|
||||
if (method_exists($morph, 'withTrashed')) {
|
||||
return $morph->withTrashed();
|
||||
}
|
||||
|
||||
return $morph;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue