/**
  * @return array
  */
 public function getCacheMap()
 {
     $settings = Setting::orderBy('group')->orderBy('key')->select('group', 'key', 'value')->get();
     $settings = $settings->groupBy('group');
     $map = [];
     foreach ($settings as $groupName => $groupSettings) {
         foreach ($groupSettings as $setting) {
             $map[$groupName][$setting->key] = $setting->value;
         }
     }
     return collect($map);
 }
Esempio n. 2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $parray = array('circuit_stewards', 'treasurer', 'superintendent', 'circuit_secretary', 'site_editors', 'supervisor_of_studies', 'local_preachers_secretary');
     $settings = Setting::orderBy('category')->orderBy('setting_field')->get();
     foreach ($settings as $setting) {
         if (!in_array($setting->setting_field, $parray)) {
             $data[$setting->category][$setting->setting_field] = $setting->setting_value;
         } else {
             $data[$setting->category][$setting->setting_field] = "";
             $indarray = explode(',', $setting->setting_value);
             foreach ($indarray as $ind) {
                 if ($data[$setting->category][$setting->setting_field] != "") {
                     $data[$setting->category][$setting->setting_field] .= ", ";
                 }
                 $indiv = Individual::find($ind);
                 $data[$setting->category][$setting->setting_field] .= $indiv->title . " " . $indiv->firstname . " " . $indiv->surname;
             }
         }
     }
     return View::make('settings.index', $data);
 }