fedi-feed-router/database/factories/PlatformInstanceFactory.php

41 lines
936 B
PHP
Raw Normal View History

2025-07-06 01:35:59 +02:00
<?php
namespace Database\Factories;
use App\Models\PlatformInstance;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends Factory<PlatformInstance>
*/
class PlatformInstanceFactory extends Factory
{
protected $model = PlatformInstance::class;
public function definition(): array
{
return [
'platform' => 'lemmy',
'name' => $this->faker->words(2, true),
'url' => $this->faker->url(),
'is_active' => true,
];
}
public function inactive(): static
{
return $this->state(fn (array $attributes) => [
'is_active' => false,
]);
}
public function lemmy(): static
{
return $this->state(fn (array $attributes) => [
'platform' => 'lemmy',
'name' => 'Lemmy '.$this->faker->word(),
'url' => 'https://lemmy.'.$this->faker->domainName(),
2025-07-06 01:35:59 +02:00
]);
}
}