Files
keystone/database/seeders/DatabaseSeeder.php
Harry Bayliss 85c44296ac
Some checks failed
CI / Tests (push) Failing after 56s
CI / Lint (push) Failing after 1m35s
Restructure UX and seed a fully simulated organisation
Rework the dashboard, environment topology view, header navigation, and
status rendering, and standardise selects on a shadcn-vue component.

Replace the thin database seeder with a SimulatedEnvironmentSeeder that
builds a fully wired, mostly-running organisation (ACTIVE server fleet,
managed + GHCR registries, Gitea source provider, ClipBin app with
production/staging environments, services, slices, endpoints, managed
variables, build artifacts, and a completed/in-progress/failed operations
history) so the new UI renders against realistic data.
2026-06-08 22:09:57 +01:00

44 lines
1.1 KiB
PHP

<?php
namespace Database\Seeders;
use App\Enums\OrganisationRole;
use App\Enums\ProviderType;
use App\Models\Organisation;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
$user = User::factory()->create([
'name' => 'Harry',
'email' => 'harry@hjb.dev',
'password' => env('DEFAULT_PASSWORD') ?: Hash::make('password'),
]);
$organisation = Organisation::create([
'name' => 'Stratbucket',
'slug' => 'stratbucket',
'owner_id' => 1,
]);
$organisation->members()->attach($user, ['role' => OrganisationRole::ADMIN]);
$provider = $organisation->providers()->create([
'name' => 'Hetzner',
'type' => ProviderType::HETZNER,
'token' => env('HETZNER_KEY') ?: 'local-placeholder-token',
]);
if (! app()->isProduction()) {
app(SimulatedEnvironmentSeeder::class)->seed($organisation, $provider);
}
}
}