chore(choose us): menghapus kolom icon dan warna dan menyesuaikan logikanya

This commit is contained in:
Yoga Pangestu 2025-11-06 13:44:26 +07:00
parent d5e556fe0c
commit b23a2d2989
3 changed files with 0 additions and 34 deletions

View File

@ -13,17 +13,11 @@ class ChooseUsForm extends Form
public string $description = '';
public string $color = '';
public string $icon = '';
public function rules(): array
{
return [
'name' => ['required', 'string', 'max:50'],
'description' => ['required', 'string'],
'color' => ['required', 'string', 'max:20'],
'icon' => ['required', 'string', 'max:20'],
];
}
@ -32,8 +26,6 @@ public function validationAttributes(): array
return [
'name' => 'nama',
'description' => 'keterangan',
'color' => 'warna',
'icon' => 'ikon',
];
}
@ -43,8 +35,6 @@ public function setChooseUs(ChooseUs $chooseUs)
$this->name = $chooseUs->name;
$this->description = $chooseUs->description;
$this->color = $chooseUs->color;
$this->icon = $chooseUs->icon;
}
public function store()
@ -54,8 +44,6 @@ public function store()
ChooseUs::create([
'name' => $this->name,
'description' => $this->description,
'color' => $this->color,
'icon' => $this->icon,
'sort_order' => ChooseUs::count() + 1,
]);
}
@ -67,8 +55,6 @@ public function update()
$this->chooseUs->update([
'name' => $this->name,
'description' => $this->description,
'color' => $this->color,
'icon' => $this->icon,
]);
}

View File

@ -15,8 +15,6 @@ public function up(): void
$table->id();
$table->string('name', 50);
$table->text('description');
$table->string('icon', 20);
$table->string('color', 20);
$table->unsignedInteger('sort_order');
$table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();

View File

@ -37,24 +37,6 @@
auotocomplete="off" />
</flux:field>
<div class="lg:col-span-2">
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<flux:field>
<flux:label>Warna <span class="text-red-500 ms-1">*</span></flux:label>
<flux:input type="color" wire:model="form.color" autofocus
autocomplete="off" />
<flux:error name="form.color" />
</flux:field>
<flux:field>
<flux:label>Icon <span class="text-red-500 ms-1">*</span></flux:label>
<flux:input type="text" wire:model="form.icon" autofocus
autocomplete="off" />
<flux:error name="form.icon" />
</flux:field>
</div>
</div>
<div class="flex">
<flux:spacer />
<flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="{{ $method }}">