extruder = $extruder; $this->name = $extruder->name; $this->description = $extruder->description; $this->manufacturer_id = $extruder->manufacturer_id; $this->diameter = $extruder->diameter; $this->temp_max = $extruder->temp_max; } public function save(){ $this->validate([ 'name' => ['required', 'string', 'max:255'], 'description' => ['nullable', 'string', 'max:255'], 'manufacturer_id' => ['required', 'integer'], 'diameter' => ['required', 'string', 'max:4'], 'temp_max' => ['required', 'integer'] ]); $this->extruder->update([ 'name' => $this->name, 'description' => $this->description, 'manufacturer_id' => $this->manufacturer_id, 'diameter' => $this->diameter, 'temp_max' => $this->temp_max ]); return $this->redirectRoute('extruder.show', $this->extruder->id, navigate: true); } public function cancel(){ return $this->redirectRoute('extruder.index', navigate: true); } public function render() { return view('livewire.extruder.edit', [ ]); } }