chore(choose us): menghapus kolom icon dan warna dan menyesuaikan logikanya
This commit is contained in:
parent
d5e556fe0c
commit
b23a2d2989
@ -13,17 +13,11 @@ class ChooseUsForm extends Form
|
|||||||
|
|
||||||
public string $description = '';
|
public string $description = '';
|
||||||
|
|
||||||
public string $color = '';
|
|
||||||
|
|
||||||
public string $icon = '';
|
|
||||||
|
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'name' => ['required', 'string', 'max:50'],
|
'name' => ['required', 'string', 'max:50'],
|
||||||
'description' => ['required', 'string'],
|
'description' => ['required', 'string'],
|
||||||
'color' => ['required', 'string', 'max:20'],
|
|
||||||
'icon' => ['required', 'string', 'max:20'],
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,8 +26,6 @@ public function validationAttributes(): array
|
|||||||
return [
|
return [
|
||||||
'name' => 'nama',
|
'name' => 'nama',
|
||||||
'description' => 'keterangan',
|
'description' => 'keterangan',
|
||||||
'color' => 'warna',
|
|
||||||
'icon' => 'ikon',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,8 +35,6 @@ public function setChooseUs(ChooseUs $chooseUs)
|
|||||||
|
|
||||||
$this->name = $chooseUs->name;
|
$this->name = $chooseUs->name;
|
||||||
$this->description = $chooseUs->description;
|
$this->description = $chooseUs->description;
|
||||||
$this->color = $chooseUs->color;
|
|
||||||
$this->icon = $chooseUs->icon;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store()
|
public function store()
|
||||||
@ -54,8 +44,6 @@ public function store()
|
|||||||
ChooseUs::create([
|
ChooseUs::create([
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'color' => $this->color,
|
|
||||||
'icon' => $this->icon,
|
|
||||||
'sort_order' => ChooseUs::count() + 1,
|
'sort_order' => ChooseUs::count() + 1,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -67,8 +55,6 @@ public function update()
|
|||||||
$this->chooseUs->update([
|
$this->chooseUs->update([
|
||||||
'name' => $this->name,
|
'name' => $this->name,
|
||||||
'description' => $this->description,
|
'description' => $this->description,
|
||||||
'color' => $this->color,
|
|
||||||
'icon' => $this->icon,
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,8 +15,6 @@ public function up(): void
|
|||||||
$table->id();
|
$table->id();
|
||||||
$table->string('name', 50);
|
$table->string('name', 50);
|
||||||
$table->text('description');
|
$table->text('description');
|
||||||
$table->string('icon', 20);
|
|
||||||
$table->string('color', 20);
|
|
||||||
$table->unsignedInteger('sort_order');
|
$table->unsignedInteger('sort_order');
|
||||||
$table->timestamp('created_at')->useCurrent();
|
$table->timestamp('created_at')->useCurrent();
|
||||||
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
|
$table->timestamp('updated_at')->useCurrent()->useCurrentOnUpdate();
|
||||||
|
|||||||
@ -37,24 +37,6 @@
|
|||||||
auotocomplete="off" />
|
auotocomplete="off" />
|
||||||
</flux:field>
|
</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">
|
<div class="flex">
|
||||||
<flux:spacer />
|
<flux:spacer />
|
||||||
<flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="{{ $method }}">
|
<flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="{{ $method }}">
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user