Files
muninn/database/factories/SiteFactory.php
T

33 lines
760 B
PHP

<?php
namespace Database\Factories;
use App\Models\Site;
use Illuminate\Database\Eloquent\Factories\Factory;
class SiteFactory extends Factory
{
protected $model = Site::class;
public function definition(): array
{
return [
'name' => fake()->company(),
'url' => fake()->url(),
'description' => fake()->optional()->sentence(),
'cms_type' => 'custom',
'wp_username' => null,
'wp_app_password' => null,
];
}
public function wordpress(): static
{
return $this->state(fn () => [
'cms_type' => 'wordpress',
'wp_username' => fake()->userName(),
'wp_app_password' => fake()->password(),
]);
}
}