<?php  namespace App\Traits;  use App\Models\UserActivity; use App\Enums\UserActivityType; use Illuminate\Contracts\Auth\Authenticatable; use Illuminate\Database\Eloquent\Relations\MorphMany;  trait HasUserActivity { 	protected static function bootHasUserActivity(): void 	{ 		static::deleting(static function (object $model): void { 			$model->activities->each(static function (UserActivity $item): void { 				$item->delete(); 			});  			foreach ($model->getUserActivityLinkedRelations() as $relation) { 				$relation->recordUserActivity(UserActivityType::Delete, [ 					'model_type' => $model::class, 					'model_id' => $model->getKey(), 				]); 			} 		});  		static::created(static function (object $model): void { 			$model->recordUserActivity(UserActivityType::Create);  			foreach ($model->getUserActivityLinkedRelations() as $relation) { 				$relation->recordUserActivity(UserActivityType::Create, [ 					'model_type' => $model::class, 					'model_id' => $model->getKey(), 				]); 			} 		});  		static::updated(static function (object $model): void { 			$fields = $model->getChanges(); 			unset($fields[$model->getUpdatedAtColumn()]); 			$fields = array_keys($fields); 			sort($fields);  			$model->recordUserActivity(UserActivityType::Update, [ 				'updated_fields' => $fields, 			]);  			foreach ($model->getUserActivityLinkedRelations() as $relation) { 				$relation->recordUserActivity(UserActivityType::Update, [ 					'model_type' => $model::class, 					'model_id' => $model->getKey(), 					'updated_fields' => $fields, 				]); 			} 		}); 	}  	public function activities(): MorphMany{}  	public function recordReadActivity(?bool $every = null, ?bool $update = null): self{}  	public function recordEveryReadActivity(): bool{}  	public function updateReadActivity(): bool{}  	public function getUserActivityTitle(): ?string{}  	public function getUserActivityUrl(): ?string{}  	public function shouldRecordUserActivity(UserActivityType $type): bool{}  	public function getUserActivityLinkedRelations(): array{}  	public function recordUserActivity(UserActivityType $type, array $data = []): void{} }