connection = $this->getConnection(); } /** * Get database connection */ protected function getConnection(): Connection { $config = include __DIR__ . '/../../Config/database.php'; $connectionConfig = $config['connections'][$config['default']]; return new Connection($connectionConfig); } /** * Run the seeder */ abstract public function run(): void; /** * Call another seeder */ protected function call(string $seeder): void { $seederClass = "Database\\Seeders\\{$seeder}"; if (!class_exists($seederClass)) { throw new \Exception("Seeder class {$seederClass} not found"); } $seederInstance = new $seederClass(); $seederInstance->run(); } }