Fix incorrect API definitions

This commit is contained in:
DaneEveritt 2022-06-05 18:28:08 -04:00
parent 2a2fc42e37
commit d1da46c5aa
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 13 additions and 2 deletions

View file

@ -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());

View file

@ -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()

View file

@ -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;
}
}