/**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     Schema::create('system_settings', function (Blueprint $table) {
         $table->integer('id');
         $table->primary('id');
         $table->string('label');
         $table->string('value');
         $table->integer('enabled')->default(1);
         $table->timestamps();
     });
     // Add initial system settings
     Eloquent::unguard();
     SystemSetting::create(['id' => SystemSetting::AskDestlerTextID, 'label' => 'Ask Destler Text', 'value' => "We'll be asking Destler your questions on September 24th, at 5:00 PM on WITR 89.7"]);
     SystemSetting::create(['id' => SystemSetting::DJHoursFormLocationID, 'label' => 'DJ Hours Form Location', 'value' => 'https://google.com/']);
     SystemSetting::create(['id' => SystemSetting::CDSignoutFormLocationID, 'label' => 'CD Signout Form Location', 'value' => 'https://google.com/']);
     SystemSetting::create(['id' => SystemSetting::FrontPageBannerTextID, 'label' => 'Front Page Banner Text', 'value' => 'WITR Engineers are currently learning about electricity! Things might flicker a little...stay tuned!', 'enabled' => 0]);
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request)
 {
     $input = $request->all();
     $settings = SystemSetting::all();
     foreach ($settings as $setting) {
         $value = $input['value_' . $setting->id];
         $setting->value = $value;
         $enabled_id = 'enabled_' . $setting->id;
         if (array_key_exists($enabled_id, $input)) {
             $setting->enabled = $input[$enabled_id];
         } else {
             $setting->enabled = 1;
         }
         $setting->save();
     }
     return redirect()->route('admin.settings')->with('success', 'Settings Saved!');
 }
 public function index()
 {
     $destlerText = SystemSetting::askDestlerText();
     return view('askdestler.index', ['destlerText' => $destlerText]);
 }
Example #4
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $banner = SystemSetting::frontPageBannerText();
     return view('home.index')->withBanner($banner);
 }
Example #5
0
 public function index()
 {
     $workHoursForm = SystemSetting::djHoursFormLocation()->value;
     $cdSignoutForm = SystemSetting::cdSignoutFormLocation()->value;
     return view('dj.index', compact('workHoursForm', 'cdSignoutForm'));
 }