fix(reward tier): menghapus kolom how_to_get
This commit is contained in:
parent
52a9730a67
commit
2a7ccac081
@ -17,15 +17,12 @@ class RewardForm extends Form
|
||||
|
||||
public string $value = '';
|
||||
|
||||
public ?string $how_to_get = null;
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'tier_id' => ['required', Rule::exists('tiers', 'id')],
|
||||
'name' => ['required', 'string', 'max:100'],
|
||||
'value' => ['required', new UnsignedInteger],
|
||||
'how_to_get' => 'nullable',
|
||||
];
|
||||
}
|
||||
|
||||
@ -34,7 +31,6 @@ public function validationAttributes(): array
|
||||
return [
|
||||
'name' => 'nama',
|
||||
'value' => 'nilia',
|
||||
'how_to_get' => 'cara mendapatkan',
|
||||
];
|
||||
}
|
||||
|
||||
@ -45,7 +41,6 @@ public function setRewards(TierReward $tierReward)
|
||||
$this->tier_id = $tierReward->tier_id;
|
||||
$this->name = $tierReward->name;
|
||||
$this->value = currency($tierReward->value);
|
||||
$this->how_to_get = $tierReward->how_to_get;
|
||||
}
|
||||
|
||||
public function store()
|
||||
@ -70,7 +65,6 @@ private function prepareSavedData()
|
||||
'tier_id' => $this->tier_id,
|
||||
'name' => $this->name,
|
||||
'value' => replaceCurrency($this->value),
|
||||
'how_to_get' => $this->how_to_get,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,6 @@ public function up(): void
|
||||
$table->foreignId('tier_id')->constrained()->cascadeOnDelete();
|
||||
$table->string('name', 100);
|
||||
$table->unsignedInteger('value');
|
||||
$table->text('how_to_get')->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
|
||||
@ -70,10 +70,6 @@
|
||||
<flux:error name="form.value" />
|
||||
</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">
|
||||
<flux:spacer />
|
||||
<flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="{{ $method }}">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user