27 lines
673 B
PHP
27 lines
673 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\EggCollection;
|
|
use App\Models\Warehouse;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\EggCollection>
|
|
*/
|
|
class EggCollectionFactory extends Factory
|
|
{
|
|
protected $model = EggCollection::class;
|
|
|
|
public function definition(): array
|
|
{
|
|
$dateTime = $this->faker->dateTimeBetween('-1 month', 'now');
|
|
|
|
return [
|
|
'production_date' => $dateTime,
|
|
'warehouse_id' => Warehouse::first()?->id ?? Warehouse::factory(),
|
|
'notes' => $this->faker->optional(0.4)->sentence(),
|
|
];
|
|
}
|
|
}
|