Fix incorrect API definitions
This commit is contained in:
parent
2a2fc42e37
commit
d1da46c5aa
3 changed files with 13 additions and 2 deletions
|
@ -20,6 +20,7 @@ class ActivityLogController extends ClientApiController
|
|||
AllowedFilter::exact('ip'),
|
||||
AllowedFilter::partial('event'),
|
||||
])
|
||||
->allowedSorts(['timestamp'])
|
||||
->paginate(min($request->query('per_page', 50), 100))
|
||||
->appends($request->query());
|
||||
|
||||
|
|
|
@ -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…
Reference in a new issue