modalLoaded = true; } public function mount($editId) { $this->licenseId = $editId; $this->loadData(); } public function loadData() { $license = ConfServerLicense::find($this->licenseId); if ($license) { $this->serverKey = $license->SNKEY; $this->teamId = $license->NBTEAM; $this->customerSize = $license->CUSTOMERSIZE; $this->customerType = $license->CUSTOMERTYPE; $this->company = $license->COMPANY; $this->branch = $license->BRANCH; $this->status = $license->STATUS; $this->licenseDate = $license->LICENSEDATE; $this->phpVersionId = $license->PHP_VERSION_ID; $this->currentVersion = $license->CUR_VERSION; $this->installDate = $license->INSTALL_DATE; $this->installVersion = $license->INSTALL_VERSION; $this->databaseType = $license->DATABASETYPE; $this->ownerType = $license->OWNERTYPE; $this->hscodeMethod = $license->HSCODEMETHOD; $this->customerUrl = $license->CUSTOMERURL; $this->contact = $license->CONTACT; $this->contactCustomerName = $license->CONTACTCUSTOMERNAME; } $this->phpVersions = DB::table('master_php_ver') ->orderBy('id', 'asc') ->get(); $this->teams = DB::table('master_team') ->orderBy('id', 'asc') ->get(); $this->sizings = DB::table('master_size') ->orderBy('id', 'asc') ->get(); $this->customerTypes = DB::table('master_sizeType') ->orderBy('id', 'asc') ->get(); $this->dbTypes = DB::table('master_dbtype') ->orderBy('id', 'asc') ->get(); $this->ownerTypes = DB::table('conf_server_ownertype') ->orderBy('owntypeid', 'asc') ->get(); } public function updateLicense() { // dd( $this->teamId); $license = ConfServerLicense::find($this->licenseId); if ($license) { $license->update([ 'SNKEY' => $this->serverKey, 'NBTEAM' => $this->teamId, 'CUSTOMERSIZE' => $this->customerSize, 'CUSTOMERTYPE' => $this->customerType, 'COMPANY' => $this->company, 'BRANCH' => $this->branch, 'STATUS' => $this->status, 'LICENSEDATE' => $this->licenseDate, 'PHP_VERSION_ID' => $this->phpVersionId, 'CUR_VERSION' => $this->currentVersion, 'INSTALL_DATE' => $this->installDate, 'INSTALL_VERSION' => $this->installVersion, 'DATABASETYPE' => $this->databaseType, 'OWNERTYPE' => $this->ownerType, 'HSCODEMETHOD' => $this->hscodeMethod, 'CUSTOMERURL' => $this->customerUrl, 'CONTACT' => $this->contact, 'CONTACTCUSTOMERNAME' => $this->contactCustomerName, ]); $message = 'Server License updated successfully!'; $this->message = $message; // session()->flash('message', 'Server License updated successfully!'); } } public function loadPage($page) { $this->emit('menuChanged', $page); } public function render() { return view('livewire.pages.server-license.server-license-edit'); } }