fixed filament.blade.php

This commit is contained in:
2025-04-22 19:25:54 +02:00
parent cf81ce810b
commit 1f10d68542
5 changed files with 69 additions and 20 deletions
+12 -3
View File
@@ -20,6 +20,7 @@ class Filament extends Component
#[Validate('required')]
public $name = '';
public $description = '';
public $diameter = '1.75';
public $color_id = '';
@@ -44,9 +45,9 @@ class Filament extends Component
$filament->name = $this->name;
$filament->description = $this->description;
$filament->diameter = $this->diameter;
$filament->color_id = Color::Find($this->color_id);
$filament->filament_type_id = Type::Find($this->type_id);
$filament->manufacturer_id = Manufacturer::Find($this->manufacturer_id);
$filament->color_id = $this->color_id;
$filament->filament_type_id = $this->type_id;
$filament->manufacturer_id = $this->manufacturer_id;
$filament->weight = $this->weight;
$filament->price = $this->price;
$filament->stock = $this->stock;
@@ -58,6 +59,14 @@ class Filament extends Component
// Close the modal
Flux::modal('createModal')->close();
}
public function cancel() {
$this->resetInputFields();
Flux::modals()->close();
}
public function resetInputFields() {
$this->reset(['name', 'description', 'diameter', 'color_id', 'type_id', 'manufacturer_id', 'weight', 'price', 'stock', 'deleteid', 'editid']);
}
public function render()
{
return view('livewire.filament.filament', [