toArray(); foreach ($options as $key => $value) { $options[$key] = [ 'value' => $value, 'label' => ucwords(str_replace('_', ' ', $key)) ]; } $settings[str_replace('Settings.php', '', $file)] = $options; } $settings->sort(); $themes = array_diff(scandir(base_path('themes')), array('..', '.')); return view('admin.settings.index', [ 'settings' => $settings->all(), 'themes' => $themes, 'active_theme' => Theme::active(), ]); } }