- menyesuaikan model jika ada yang salah seperti kurangnya trait SoftDeletes, casting yang salah, relasi yang kurang dan lainnya - memperbaiki enum di migrasi
23 lines
495 B
PHP
23 lines
495 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Outlet;
|
|
use App\Models\OutletProduct;
|
|
use App\Models\Product;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class OutletProductFactory extends Factory
|
|
{
|
|
protected $model = OutletProduct::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'outlet_id' => Outlet::factory(),
|
|
'product_id' => Product::factory(),
|
|
'stock' => $this->faker->numberBetween(0, 500),
|
|
];
|
|
}
|
|
}
|