*/ class StockItemFactory extends Factory { protected $model = StockItemModel::class; /** * @return array */ public function definition(): array { return [ 'stock_item_group_id' => StockItemGroupModel::factory(), 'name' => fake()->unique()->words(3, true), 'unit' => StockUnit::Piece, 'code' => null, 'supplier' => null, 'reorder_level_milli' => null, 'average_cost_hundredths' => 0, 'is_active' => true, ]; } public function inactive(): static { return $this->state(fn (): array => ['is_active' => false]); } }