public function indexSSR(DataTableSearch $request): JsonResponse 	{ 		$categories = Category::withCount('activities')->where('domain_id', auth()->user()->user->activeDomain?->getKey()); 		$token = auth()->user()->token();  		return DataTables::eloquent($categories) 		->order(static function (object $query) use ($request): void { 			$order_array = $request->get('order') ?? []; 			$columns_array = $request->columns;  			if (filled($order_array)) { 				foreach (array_column($order_array, 'dir', 'column') as $column_index => $order_direction) { 					$query->orderBy($columns_array[$column_index]['name'], $order_direction); 				} 			} else { 				$query->latest(); 			} 		}) 		->addColumn('edit', static fn (Category $row): View => view('layouts.edit_button', ['path' => ['categories.edit' => $row->getKey()]])) 		->addColumn('name', static fn (Category $row): string => $row->getDefaultTranslation('name')) 		->addColumn('activities_count', static function (Category $row) use ($token): string { 			$activity_modal = json_encode([ 				'api' => route('api.domains.categories.activities', [auth()->user()->user->activeDomain->domain, $row->getKey()]), 				'token' => $token, 				'name' => $row->getDefaultTranslation('name') . ' > ' . __('activities.activity'), 			], JSON_THROW_ON_ERROR);  			return '<a href="#" title="' . __('activities.activity') . '" data-modal-data=\'' . $activity_modal . '\' data-toggle="modal" data-target="#activity-modal" class="text-hover-primary"> 				<i class="fa fa-clock"></i> ' . $row->activities_count . ' 			</a>'; 		}) 		->addColumn('ordering', static fn (Category $row): int => $row->ordering) 		->addColumn('active', static fn (Category $row): View => view('layouts.bool_badge', ['value' => $row->active])) 		->addColumn('created_at', static fn (Category $row): string => '<td data-order="' . formatTimestamp($row->created_at, 'U') . '">' . formatLocalTimestamp($row->created_at) . '</td>') 		->addColumn('checkbox', static fn (Category $row): View => view('layouts.option_buttons', ['value' => $row->getKey()])) 		->rawColumns([ 			'edit', 			'name', 			'activities_count', 			'active', 			'created_at', 			'checkbox', 		]) 		->toJson(); 	}