🚀 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
$

📄 OrderItemFactory.php

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

namespace Database\Factories;

use App\Modules\Catalog\Models\Product;
use App\Modules\Order\Models\Order;
use App\Modules\Order\Models\OrderItem;
use Illuminate\Database\Eloquent\Factories\Factory;

class OrderItemFactory extends Factory
{
    protected $model = OrderItem::class;

    public function definition(): array
    {
        $unitPrice = fake()->randomFloat(2, 100, 2000);
        $qty       = fake()->numberBetween(1, 5);

        return [
            'order_id'     => Order::factory(),
            'product_id'   => Product::factory(),
            'product_name' => fake()->words(3, true),
            'sku'          => strtoupper(fake()->bothify('??-####')),
            'quantity'     => $qty,
            'unit_price'   => $unitPrice,
            'discount_amount' => 0,
            'tax_amount'   => round($unitPrice * $qty * 0.13, 2),
            'tax_rate'     => 13.00,
            'total_price'  => round($unitPrice * $qty, 2),
        ];
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨