mirror of
https://git.meshkee.com/cssd/cssd-back.git
synced 2026-10-12 09:21:20 +03:30
feat: add factory for models
This commit is contained in:
Executable
+29
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Input>
|
||||
*/
|
||||
class InputFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'name' => $this->faker->word,
|
||||
'type' => $this->faker->randomElement(['Text', 'Form', 'Checkbox', 'Select']),
|
||||
'test_type_id' => \App\Models\TestType::factory(),
|
||||
'parent_id' => null,
|
||||
'size' => $this->faker->word,
|
||||
'value' => $this->faker->word,
|
||||
'require_scanner' => $this->faker->boolean,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user