ldc-startcoq/database/factories/PackagingFactory.php
2023-06-21 10:24:56 +00:00

52 lines
1.6 KiB
PHP

<?php
namespace Database\Factories;
use App\Enums\Packaging\OriginEnum;
use App\Enums\Packaging\WatchTypeEnum;
use App\Enums\Packaging\TypeEnum;
use App\Enums\Packaging\MaterialEnum;
use App\Enums\Packaging\BenefitEnum;
use App\Models\Packaging;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<\App\Models\Packaging>
*/
final class PackagingFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Packaging::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition(): array
{
return [
'user_id' => fake()->randomElement(User::pluck('id')),
'watch_type' => \collect(WatchTypeEnum::toArray())->random()->value,
'supplier' => fake()->word,
'name' => fake()->name,
'product_description' => fake()->word,
'origin' => \collect(OriginEnum::toArray())->random()->value,
'is_sample' => fake()->boolean,
'type_packaging' => \collect(TypeEnum::toArray())->random()->value,
'material' => \collect(MaterialEnum::toArray())->random()->value,
'benefit' => \collect(BenefitEnum::toArray())->random()->value,
'observation' => fake()->word,
'picture' => [fake()->word],
'url' => fake()->url,
'documents' => [fake()->word],
'fair' => fake()->word,
'deleted_at' => fake()->dateTime(),
];
}
}