50 lines
1.4 KiB
PHP
50 lines
1.4 KiB
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use App\Enums\Process\ProcessWatchTypeEnum;
|
||
|
|
use App\Enums\Process\ProcessOriginEnum;
|
||
|
|
use App\Enums\Process\ProcessBenefitEnum;
|
||
|
|
use App\Models\Process;
|
||
|
|
use App\Models\User;
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<\App\Models\Process>
|
||
|
|
*/
|
||
|
|
final class ProcessFactory extends Factory
|
||
|
|
{
|
||
|
|
/**
|
||
|
|
* The name of the factory's corresponding model.
|
||
|
|
*
|
||
|
|
* @var string
|
||
|
|
*/
|
||
|
|
protected $model = Process::class;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Define the model's default state.
|
||
|
|
*
|
||
|
|
* @return array
|
||
|
|
*/
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'user_id' => fake()->randomElement(User::pluck('id')),
|
||
|
|
'watch_type' => \collect(ProcessWatchTypeEnum::cases())->random(),
|
||
|
|
'supplier' => fake()->word,
|
||
|
|
'name' => fake()->name,
|
||
|
|
'description' => fake()->text,
|
||
|
|
'origin' => \collect(ProcessOriginEnum::cases())->random(),
|
||
|
|
'is_test_machine' => fake()->boolean,
|
||
|
|
'is_quotation' => fake()->boolean,
|
||
|
|
'quotation_document' => fake()->word,
|
||
|
|
'profit' => \collect(ProcessBenefitEnum::cases())->random(),
|
||
|
|
'observation' => fake()->word,
|
||
|
|
'picture' => [fake()->word],
|
||
|
|
'documents' => [fake()->word],
|
||
|
|
'url' => fake()->url,
|
||
|
|
'deleted_at' => fake()->dateTime(),
|
||
|
|
];
|
||
|
|
}
|
||
|
|
}
|