fixed create filament
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
|
||||
<div class="container m-auto my-8">
|
||||
<div class="m-auto my-8 mx-12">
|
||||
<x-table>
|
||||
<x-slot name="tableheader">
|
||||
<x-table.header>Name</x-table.header>
|
||||
@@ -43,9 +43,9 @@
|
||||
<x-table.item><p class="p-4 px-3">{{ App\Models\Manufacturer::find($filament->manufacturer_id)->name }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ App\Models\FilamentType::find($filament->filament_type_id)->name }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $filament->diameter }} mm</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $filament->weight }} g/m</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">${{ $filament->price }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">${{ $filament->stock }}</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $filament->weight }} g</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $filament->price }}€</p></x-table.item>
|
||||
<x-table.item><p class="p-4 px-3">{{ $filament->stock }}</p></x-table.item>
|
||||
<x-table.item>
|
||||
<div class="flex flex-row gap-2 justify-start pr-2">
|
||||
<flux:button wire:click="edit({{ $filament->id }})" variant="ghost" icon="pencil">Edit</flux:button>
|
||||
@@ -63,7 +63,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Create Form -->
|
||||
<flux:modal wire:model.self='createModal' name="createModal" class="md:w-128">
|
||||
<flux:modal wire:model.self='createModal' name="createModal" class="md:w-256">
|
||||
<form wire:submit.prevent="create">
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
@@ -72,27 +72,29 @@
|
||||
</div>
|
||||
<flux:input label="Name" wire:model="name" placeholder="Filament Name" required />
|
||||
<flux:textarea label="Description" wire:model="description" placeholder="Description" />
|
||||
<flux:select wire:model="manufacturer_id" label="Manufacturer">
|
||||
<flux:select.option disabled value="">Choose Manufacturer</flux:select.option>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<flux:select.option wire:key="{{ $manufacturer->id }}" value="{{ $manufacturer->id }}">{{ $manufacturer->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:select wire:model="type_id" label="Type">
|
||||
<flux:select.option disabled value="">Choose Type</flux:select.option>
|
||||
@foreach ($types as $type)
|
||||
<flux:select.option wire:key="{{ $type->id }}" value="{{ $type->id }}">{{ $type->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:select wire:model="color_id" label="Color" >
|
||||
<flux:select.option disabled value="">Choose Color</flux:select.option>
|
||||
@foreach ($colors as $color)
|
||||
<flux:select.option wire:key="{{ $color->id }}" value="{{ $color->id }}">{{ $color->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:input label="Diameter" wire:model="diameter" placeholder="Diameter" required />
|
||||
<flux:input label="Weight" wire:model="weight" placeholder="Weight" required />
|
||||
<flux:input label="Price" wire:model="price" placeholder="Price" required />
|
||||
<div class="grid grid-cols-2 gap-x-4 gap-y-6">
|
||||
<flux:select wire:model="manufacturer_id" label="Manufacturer">
|
||||
<flux:select.option disabled value="">Choose Manufacturer</flux:select.option>
|
||||
@foreach ($manufacturers as $manufacturer)
|
||||
<flux:select.option wire:key="{{ $manufacturer->id }}" value="{{ $manufacturer->id }}">{{ $manufacturer->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:select wire:model="type_id" label="Type">
|
||||
<flux:select.option disabled value="">Choose Type</flux:select.option>
|
||||
@foreach ($types as $type)
|
||||
<flux:select.option wire:key="{{ $type->id }}" value="{{ $type->id }}">{{ $type->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:select wire:model="color_id" label="Color" >
|
||||
<flux:select.option disabled value="">Choose Color</flux:select.option>
|
||||
@foreach ($colors as $color)
|
||||
<flux:select.option wire:key="{{ $color->id }}" value="{{ $color->id }}">{{ $color->name }}</flux:select.option>
|
||||
@endforeach
|
||||
</flux:select>
|
||||
<flux:input label="Diameter" wire:model="diameter" placeholder="Diameter" required />
|
||||
<flux:input label="Weight" wire:model="weight" placeholder="Weight" required />
|
||||
<flux:input label="Price" wire:model="price" placeholder="Price" required />
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<flux:spacer />
|
||||
<flux:button variant="ghost" wire:click='cancel'>Cancel</flux:button>
|
||||
|
||||
Reference in New Issue
Block a user