public function activities(DatatableSearch $request): JsonResponse 	{ 		$activities = UserActivity::withoutGlobalScope('limited-scope') 		->select([ 			'user_activities.id', 			'user_activities.item_id', 			'user_activities.item_type', 			'user_activities.user_id', 			'users.name as user_name', 			'route_name', 			'ip_address as ip_address_column', 			'type', 			DB::raw("replace(regexp_replace(json_unquote(updated_fields), '[\\[\\]\"]]+', ''), '[', '') as updated_field_column"), 			'user_activities.created_at', 		])->join('users', 'users.id', '=', 'user_activities.user_id') 		->with('item') 		->byDomain(auth()->user()->user->getActiveDomain()) 		->latest('user_activities.created_at');  		return DataTables::eloquent($activities) 		->addColumn('item_type_column', function (UserActivity $row) { 			$route = $row->item?->getUserActivityUrl(); 			$title = $row->item?->getUserActivityTitle();  			return '<a href="' . $route . '">' . $title . '</a>'; 		}) 		->addColumn('activity_type_column', function (UserActivity $row) { 			return '<span class="label label-' . $row->type->getBadgeByType() . ' label-inline label-rounded">' . __('activities.list.' . $row->type->value) . '</span>'; 		}) 		->addColumn('name_column', function (UserActivity $row) { 			$route = $row->user?->user->getUserEditUrl();  			$title = $row->user_name;  			return '<a href="' . $route . '">' . $title . '</a>'; 		}) 		->addColumn('created_at_column', function (UserActivity $row) { 			return formatLocalTimestamp($row->created_at); 		}) 		->addColumn('action', function (UserActivity $row) { 			return $row->route_name ? __('activities.custom-messages.' . $row->route_name) : null; 		}) 		->only(['name_column', 'ip_address_column', 'item_type_column', 'created_at_column', 'activity_type_column', 'updated_field_column', 'action']) 		->filter(function ($query) use ($request) { 			$search_term = $request->search['value'] ?? null;  			if ($search_term) { 				$query->search($search_term); 			} 		}) 		->rawColumns(['name_column', 'activity_type_column', 'item_type_column', 'created_at_column', 'action']) 		->toJson(); 	}