reportName = $reportName; // Fetch the DataTable configuration $datatableConfigQuery = DB::table('reports')->where('name', $reportName)->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')->title($this->title)->layout('components.layouts.reports'); } }