Commit a2d272e4 authored by Nicolas Widart's avatar Nicolas Widart

Refactoring the all method

parent f4851348
...@@ -23,12 +23,7 @@ class SettingController extends AdminBaseController ...@@ -23,12 +23,7 @@ class SettingController extends AdminBaseController
public function index() public function index()
{ {
$rawSettings = $this->setting->all(); $settings = $this->setting->all();
$settings = [];
foreach ($rawSettings as $setting) {
$settings[$setting->name] = $setting;
}
return View::make('setting::admin.settings', compact('settings')); return View::make('setting::admin.settings', compact('settings'));
} }
......
...@@ -24,6 +24,18 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin ...@@ -24,6 +24,18 @@ class EloquentSettingRepository extends EloquentBaseRepository implements Settin
{ {
} }
public function all()
{
$rawSettings = parent::all();
$settings = [];
foreach ($rawSettings as $setting) {
$settings[$setting->name] = $setting;
}
return $settings;
}
/** /**
* Create or update the settings * Create or update the settings
* @param $settings * @param $settings
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment