Updated Buildplate Forms

This commit is contained in:
2025-11-10 21:00:56 +01:00
parent 1e951c5109
commit d306b5af84
2 changed files with 22 additions and 1 deletions
+21
View File
@@ -31,6 +31,27 @@ class Buildplate extends Component
public $editid = ''; public $editid = '';
public $deleteid = ''; public $deleteid = '';
public function create() {
@Auth::check();
// Validate
$this->validate();
$buildplate = new BuildplateModel();
$buildplate->name = $this->name;
$buildplate->description = $this->description;
$buildplate->manufacturer_id = $this->manufacturer_id;
$buildplate->temp_max = $this->temp_max;
$buildplate->amount = $this->amount;
$buildplate->save();
// Clear the form
$this->resetInputFields();
// Close the modal
Flux::modal('createModal')->close();
}
public function edit($buildplateid) { public function edit($buildplateid) {
@Auth::check(); @Auth::check();
@@ -136,7 +136,7 @@
<div class="flex gap-2"> <div class="flex gap-2">
<flux:spacer /> <flux:spacer />
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button> <flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
<flux:button type="submit" variant="danger">Delete color</flux:button> <flux:button type="submit" variant="danger">Delete Buildplate</flux:button>
</div> </div>
</div> </div>
</form> </form>