2023-02-23 16:23:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Database\Factories;
|
|
|
|
|
|
2023-06-21 10:24:56 +00:00
|
|
|
use App\Enums\Process\WatchTypeEnum;
|
|
|
|
|
use App\Enums\Process\OriginEnum;
|
|
|
|
|
use App\Enums\Process\BenefitEnum;
|
2023-02-23 16:23:00 +01:00
|
|
|
use App\Models\Process;
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @extends Factory<\App\Models\Process>
|
|
|
|
|
*/
|
|
|
|
|
final class ProcessFactory extends Factory
|
|
|
|
|
{
|
|
|
|
|
/**
|
2023-06-21 10:24:56 +00:00
|
|
|
* The name of the factory's corresponding model.
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
2023-02-23 16:23:00 +01:00
|
|
|
protected $model = Process::class;
|
|
|
|
|
|
|
|
|
|
/**
|
2023-06-21 10:24:56 +00:00
|
|
|
* Define the model's default state.
|
|
|
|
|
*
|
|
|
|
|
* @return array
|
|
|
|
|
*/
|
2023-02-23 16:23:00 +01:00
|
|
|
public function definition(): array
|
|
|
|
|
{
|
|
|
|
|
return [
|
|
|
|
|
'user_id' => fake()->randomElement(User::pluck('id')),
|
2023-06-21 10:24:56 +00:00
|
|
|
'watch_type' => \collect(WatchTypeEnum::toArray())->random()->value,
|
2023-02-23 16:23:00 +01:00
|
|
|
'supplier' => fake()->word,
|
|
|
|
|
'name' => fake()->name,
|
|
|
|
|
'description' => fake()->text,
|
2023-06-21 10:24:56 +00:00
|
|
|
'origin' => \collect(OriginEnum::toArray())->random()->value,
|
2023-02-23 16:23:00 +01:00
|
|
|
'is_test_machine' => fake()->boolean,
|
|
|
|
|
'is_quotation' => fake()->boolean,
|
|
|
|
|
'quotation_document' => fake()->word,
|
2023-06-21 10:24:56 +00:00
|
|
|
'profit' => \collect(BenefitEnum::toArray())->random()->value,
|
2023-02-23 16:23:00 +01:00
|
|
|
'observation' => fake()->word,
|
|
|
|
|
'picture' => [fake()->word],
|
|
|
|
|
'documents' => [fake()->word],
|
|
|
|
|
'url' => fake()->url,
|
|
|
|
|
'deleted_at' => fake()->dateTime(),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|