<?php
/**
 * Globals Package Main Seeder Class
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @package     bplan-base/globals
 * @subpackage  Seeders
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */

namespace Database\Seeders;


use Illuminate\Database\Seeder;


/**
 * Globals Package Main Seeder Class
 *
 * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
class GlobalsSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     *
     * @author      Emilio Cannarozzo <emilio.cannarozzo@bplan-solutions.de>
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function run(): void
    {
        $env = strtolower(config('app.env'));

        $seeds = [];

        if ($env === 'production' || config('globals.dev.seed-production')) {
            $seeds[] = Globals\CombinedTenantSeeder::class;
            $seeds[] = Globals\CombinedUserSeeder::class;
            $seeds[] = Globals\GlobalSettingSeeder::class;

        } else {
            $seeds[] = Globals\CombinedTenantSeeder::class;
            $seeds[] = Globals\CombinedUserSeeder::class;
            $seeds[] = Globals\GlobalSettingSeeder::class;
        }
        if (!empty($seeds)) {
            $this->call($seeds);
        }
    } // run()

} // class GlobalsSeeder extends Seeder {}
