authentikate/database/factories/ApplicationFactory.php
Javier Feliz 038ee47fa3
All checks were successful
linter / quality (push) Successful in 3m8s
tests / ci (push) Successful in 13m56s
Claude be codin
2025-07-31 00:56:12 -04:00

115 lines
2.8 KiB
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Application>
*/
class ApplicationFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
// Popular apps that likely have icons in selfh.st/icons
$apps = [
'Nextcloud',
'Plex',
'Jellyfin',
'Home Assistant',
'Grafana',
'Portainer',
'Sonarr',
'Radarr',
'Lidarr',
'Bazarr',
'Overseerr',
'Tautulli',
'Ombi',
'Jackett',
'qBittorrent',
'Transmission',
'SABnzbd',
'NZBGet',
'Synology',
'FreeNAS',
'UniFi',
'pfSense',
'OPNsense',
'Pi-hole',
'AdGuard',
'Bitwarden',
'Vaultwarden',
'PhotoPrism',
'Immich',
'Paperless',
'Bookstack',
'TiddlyWiki',
'Joplin',
'Standard Notes',
'Trilium',
'Monica',
'Firefly III',
'Invoice Ninja',
'Crater',
'Akaunting',
'Ghost',
'WordPress',
'Discourse',
'Flarum',
'NodeBB',
'Rocket.Chat',
'Mattermost',
'Element',
'Synapse',
'Jitsi',
'BigBlueButton',
'Jami',
'Mumble',
'TeamSpeak',
'Discord',
'Gitea',
'GitLab',
'Forgejo',
'Gogs',
'Sourcehut',
'Drone',
'Jenkins',
'Buildbot',
'TeamCity',
'Bamboo',
'SonarQube',
'Sentry',
'Uptime Kuma',
'Healthchecks',
'Cachet',
'Zabbix',
'Nagios',
'Icinga',
'LibreNMS',
'PRTG',
'Proxmox',
'ESXi',
'XCP-ng',
'Harvester',
'Rancher'
];
$appName = $this->faker->randomElement($apps);
$kebabName = str($appName)->kebab()->toString();
return [
'name' => $appName,
'client_id' => $this->faker->uuid(),
'client_secret' => $this->faker->regexify('[A-Za-z0-9]{40}'),
'redirect_uri' => $this->faker->url() . '/auth/callback',
'icon' => "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/{$kebabName}.webp",
];
}
}