datatableName = $datatableName; // Fetch the DataTable configuration $datatableConfigQuery = DB::table('datatables')->where('name', $datatableName)->first(); if (!$datatableConfigQuery) { abort(404, 'DataTable configuration not found'); } // Store the decoded JSON as a plain array $this->datatableColumnsConfig = json_decode($datatableConfigQuery->columns_config, true); $this->datatableHeadersConfig = json_decode($datatableConfigQuery->column_headers, true); $this->datatableColumnDefsConfig = json_decode($datatableConfigQuery->column_defs, true); $this->datatableButtonsConfig = json_decode($datatableConfigQuery->buttons, true); } public function render() { return view('livewire.show-reports')->layout('components.layouts.datatables'); } }