All checks were successful
Tests / Laravel tests (pull_request) Successful in 2m36s
33 lines
821 B
PHP
33 lines
821 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Skill>
|
|
*/
|
|
class SkillFactory extends Factory
|
|
{
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'title' => fake()->randomElement(['Laravel', 'PHP', 'Docker', 'Tailwind CSS']),
|
|
'description' => fake()->sentence(),
|
|
'rating' => fake()->numberBetween(1, 10),
|
|
'type' => fake()->randomElement(['rating', 'tag', 'other']),
|
|
];
|
|
}
|
|
|
|
public function rating(): static
|
|
{
|
|
return $this->state(fn (array $attributes) => [
|
|
'type' => 'rating',
|
|
'rating' => fake()->numberBetween(1, 10),
|
|
]);
|
|
}
|
|
}
|