where('uuid', $uuid)->firstOrFail(); $this->uuid = $uuid; $this->code = $dc->code; $this->name = $dc->name; $this->location = (string) $dc->location; } public function save() { $this->authorize('datacenters.manage'); $data = $this->validate(); Datacenter::query()->where('uuid', $this->uuid)->update([ 'name' => $data['name'], 'location' => $data['location'] ?: null, ]); $this->dispatch('notify', message: __('datacenters.updated')); return $this->redirectRoute('admin.datacenters', navigate: true); } public function render() { return view('livewire.admin.edit-datacenter', [ 'countries' => config('countries'), ]); } }