/** * Execute the console command. * * @return mixed */ public function fire() { $section = $this->argument('section'); if (!empty($section)) { if (!Config::has($section)) { $this->error($section . ' does not exist in your configuration.'); return; } // If the requested string is a string, and not something that can be displayed in a table, then just print // it out in the console. $config = Config::get($section); if (!is_array($config)) { $this->line('<comment>' . $config . '</comment>'); return; } $configs = [$section => $config]; } else { $configs = Config::all(); ksort($configs); } foreach ($configs as $section => $config) { $depth = $this->getConfigDepth($config); $tree = $this->generateTree($config, $depth); $this->line('<info>Configuration:</info> <comment>' . $section . '</comment>'); $this->table([], $tree, 'default'); } }
/** * Adds data to the request and returns it */ public function resolve(Request $request) { $configs = Config::all(); foreach ($configs['database']['connections'] as $type => $connection) { if (!isset($connection['password'])) { continue; } $configs['database']['connections'][$type]['password'] = '******'; } $configs['app']['key'] = '**********'; return $configs; }
/** * Fetch data * @return void */ public function resolve() { $configs = ConfigFacade::all(); // remove DB password foreach ($configs['database']['connections'] as $type => $connection) { if (!array_key_exists('password', $connection)) { continue; } $configs['database']['connections'][$type]['password'] = '******'; } $configs['app']['key'] = '**********'; $this->data = $configs; }
/** * Execute the console command. * * @return mixed */ public function fire() { $section = $this->argument('section'); if (!empty($section)) { if (!Config::has($section)) { $this->error($section . ' does not exist in your configuration.'); return; } $configs = [$section => Config::get($section)]; } else { $configs = Config::all(); ksort($configs); } foreach ($configs as $section => $config) { $depth = $this->getConfigDepth($config); $tree = $this->generateTree($config, $depth); $this->line('<info>Configuration:</info> <comment>' . $section . '</comment>'); $this->table([], $tree, 'default'); } }