fix(reward tier): menghapus kolom how_to_get

This commit is contained in:
Yoga Pangestu 2025-11-09 20:06:56 +07:00
parent 52a9730a67
commit 2a7ccac081
3 changed files with 0 additions and 11 deletions

View File

@ -17,15 +17,12 @@ class RewardForm extends Form
public string $value = ''; public string $value = '';
public ?string $how_to_get = null;
public function rules(): array public function rules(): array
{ {
return [ return [
'tier_id' => ['required', Rule::exists('tiers', 'id')], 'tier_id' => ['required', Rule::exists('tiers', 'id')],
'name' => ['required', 'string', 'max:100'], 'name' => ['required', 'string', 'max:100'],
'value' => ['required', new UnsignedInteger], 'value' => ['required', new UnsignedInteger],
'how_to_get' => 'nullable',
]; ];
} }
@ -34,7 +31,6 @@ public function validationAttributes(): array
return [ return [
'name' => 'nama', 'name' => 'nama',
'value' => 'nilia', 'value' => 'nilia',
'how_to_get' => 'cara mendapatkan',
]; ];
} }
@ -45,7 +41,6 @@ public function setRewards(TierReward $tierReward)
$this->tier_id = $tierReward->tier_id; $this->tier_id = $tierReward->tier_id;
$this->name = $tierReward->name; $this->name = $tierReward->name;
$this->value = currency($tierReward->value); $this->value = currency($tierReward->value);
$this->how_to_get = $tierReward->how_to_get;
} }
public function store() public function store()
@ -70,7 +65,6 @@ private function prepareSavedData()
'tier_id' => $this->tier_id, 'tier_id' => $this->tier_id,
'name' => $this->name, 'name' => $this->name,
'value' => replaceCurrency($this->value), 'value' => replaceCurrency($this->value),
'how_to_get' => $this->how_to_get,
]; ];
} }
} }

View File

@ -16,7 +16,6 @@ public function up(): void
$table->foreignId('tier_id')->constrained()->cascadeOnDelete(); $table->foreignId('tier_id')->constrained()->cascadeOnDelete();
$table->string('name', 100); $table->string('name', 100);
$table->unsignedInteger('value'); $table->unsignedInteger('value');
$table->text('how_to_get')->nullable();
$table->timestamp('created_at')->useCurrent(); $table->timestamp('created_at')->useCurrent();
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate(); $table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
$table->softDeletes(); $table->softDeletes();

View File

@ -70,10 +70,6 @@
<flux:error name="form.value" /> <flux:error name="form.value" />
</flux:field> </flux:field>
<flux:editor label="Cara Mendapatkan" wire:model="form.how_to_get"
placeholder="Jelaskan kepada user cara mendapatkan / claim hadiah nya." auotocomplete="off"
class="**:data-[slot=content]:min-h-[100px]!" />
<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 }}">