update deploy
This commit is contained in:
34
database/factories/FaqFactory.php
Normal file
34
database/factories/FaqFactory.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Enums\FaqCategory;
|
||||
use App\Models\Faq;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends Factory<Faq>
|
||||
*/
|
||||
class FaqFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'category' => fake()->randomElement(FaqCategory::cases()),
|
||||
'question' => fake()->sentence().'?',
|
||||
'answer' => fake()->paragraph(),
|
||||
'order_index' => fake()->numberBetween(0, 10),
|
||||
'is_active' => true,
|
||||
];
|
||||
}
|
||||
|
||||
public function inactive(): static
|
||||
{
|
||||
return $this->state(fn (array $attributes) => [
|
||||
'is_active' => false,
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user