public function activities(Domain $domain, Document $id, SearchUserActivity $request): JsonResource 	{ 		$type = $request->enum('type', UserActivityType::class);  		return UserActivityResource::collection($id->activities() 			->includes() 			->available() 			->when($type, static function (object $query, UserActivityType $type): void { 				$query->where('type', $type); 			}) 			->search($request->search) 			->latest() 			->paginate() 			->withQueryString()); 	}