<?php

namespace Database\Seeders;

use App\Models\Central\CentralAdmin;
use Illuminate\Database\Seeder;

class CentralAdminSeeder extends Seeder
{
    public function run(): void
    {
        if (app()->environment('production')) {
            $this->command?->warn('CentralAdminSeeder skipped in production — use `php artisan central:make-admin`.');

            return;
        }

        CentralAdmin::updateOrCreate(
            ['email' => 'admin@vellix.com'],
            [
                'name' => 'Platform Admin',
                'password' => 'password',
                'is_active' => true,
            ],
        );
    }
}
