'Company', 'SNKEY' => 'Server Key', 'CUR_VERSION' => 'Current Version', 'STATUS' => 'Status', 'DATABASETYPE' => 'Database', 'PHP_VERSION_ID' => 'PHP Version' ]; public $searchSelected; public $keyword; public $results; public function filterReport() { $query = ConfServerLicense::select('ID', 'SNKEY', 'COMPANY', 'STATUS', 'CUR_VERSION', 'DATABASETYPE', 'LICENSEDATE'); if ($this->searchSelected && $this->keyword) { $query->where($this->searchSelected, 'LIKE', '%' . $this->keyword . '%'); } $this->results = $query->orderBy('ID', 'DESC')->get(); } // public function exportReport() // { // // ฟังก์ชันสำหรับการ export ข้อมูลเป็นไฟล์ // return Excel::download(new ConfServerLicenseExport($this->results), 'report.xlsx'); // } public function render() { $this->filterReport(); return view('livewire.pages.report.report-index'); } }