/** * Run the database seeds. * * @return void */ public function run() { $settings = ['site.name' => 'Pingpong CMS', 'site.description' => 'Pingpong CMS - A modern CMS based on Laravel PHP Framework', 'site.keywords' => 'pingpong, cms, pingpong labs, laravel', 'site.author' => 'Pingpong Labs, Gravitano']; foreach ($settings as $key => $value) { Setting::create(compact('key', 'value')); } }
public function update(Request $request) { $settings = $request->input('settings'); foreach ($settings as $key => $value) { Setting::whereKey($key)->update(compact('value')); } return redirect()->back(); }
function setting($key, $default = null) { return Setting::value($key, $default); }