コード例 #1
0
 /**
  * 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'));
     }
 }
コード例 #2
0
 public function update(Request $request)
 {
     $settings = $request->input('settings');
     foreach ($settings as $key => $value) {
         Setting::whereKey($key)->update(compact('value'));
     }
     return redirect()->back();
 }
コード例 #3
0
ファイル: helpers.php プロジェクト: pingpongcms/settings
 function setting($key, $default = null)
 {
     return Setting::value($key, $default);
 }