*/ public function activityLog(): BelongsTo { return $this->belongsTo(ActivityLog::class); } /** * @return \Illuminate\Database\Eloquent\Relations\MorphTo<\Illuminate\Database\Eloquent\Model, $this> */ public function subject(): MorphTo { $morph = $this->morphTo(); if (method_exists($morph, 'withTrashed')) { // @phpstan-ignore function.alreadyNarrowedType return $morph->withTrashed(); } return $morph; } }