36 lines
820 B
PHP
36 lines
820 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Database\Factories;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @extends Factory<\App\Models\Prompt>
|
||
|
|
*/
|
||
|
|
class PromptFactory extends Factory
|
||
|
|
{
|
||
|
|
protected $model = \App\Models\Prompt::class;
|
||
|
|
|
||
|
|
public function definition(): array
|
||
|
|
{
|
||
|
|
return [
|
||
|
|
'name' => fake()->unique()->sentence(3),
|
||
|
|
'description' => fake()->sentence(),
|
||
|
|
'body' => 'Summarize the following text in three bullet points: {{content}}',
|
||
|
|
'is_favorite' => false,
|
||
|
|
'usage_count' => 0,
|
||
|
|
'last_used_at' => null,
|
||
|
|
];
|
||
|
|
}
|
||
|
|
|
||
|
|
public function favorite(): static
|
||
|
|
{
|
||
|
|
return $this->state(['is_favorite' => true]);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function body(string $body): static
|
||
|
|
{
|
||
|
|
return $this->state(['body' => $body]);
|
||
|
|
}
|
||
|
|
}
|