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

📄 InventoryFactory.php

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

namespace Database\Factories;

use App\Modules\Catalog\Models\Inventory;
use App\Modules\Catalog\Models\Product;
use App\Modules\Vendor\Models\Vendor;
use Illuminate\Database\Eloquent\Factories\Factory;

class InventoryFactory extends Factory
{
    protected $model = Inventory::class;

    public function definition(): array
    {
        return [
            'product_id'          => Product::factory(),
            'vendor_id'           => Vendor::factory(),
            'variant_id'          => null,
            'quantity'            => fake()->numberBetween(10, 100),
            'reserved_quantity'   => 0,
            'low_stock_threshold' => 5,
            'allow_backorder'     => false,
            'track_inventory'     => true,
            'last_restocked_at'   => now()->subDays(fake()->numberBetween(1, 30)),
        ];
    }

    public function lowStock(): static
    {
        return $this->state([
            'quantity'            => fake()->numberBetween(1, 4),
            'low_stock_threshold' => 5,
        ]);
    }

    public function outOfStock(): static
    {
        return $this->state([
            'quantity'            => 0,
            'low_stock_threshold' => 5,
            'allow_backorder'     => false,
        ]);
    }

    public function withBackorder(): static
    {
        return $this->state([
            'quantity'        => 0,
            'allow_backorder' => true,
        ]);
    }
}
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨