Example #1
0
 public function postUpdateSettings()
 {
     $setting = ApplicationSetting::find(1);
     $exceptions = ['_token', 'apple_touch_icon_152x152', 'apple_touch_startup_image_640x920', 'apple_touch_startup_image_640x1096', 'apple_touch_startup_image_750x1334', 'apple_touch_startup_image_1242x2208', 'apple_touch_startup_image_1536x2008', 'application_shortcut_icon_196x196', 'application_favicon_ico_32x32', 'application_favicon_png_32x32', 'company_logo'];
     $input = Request::except($exceptions);
     foreach ($input as $key => $value) {
         $setting[$key] = $value;
     }
     $setting->save();
     /**
      * Handle uploading meta images such as shortcut icons,
      * Apple touch images and other assets.
      *
      * @param array $images
      * @param       $destinationPath
      */
     function saveUploadedImages($images = [], $destinationPath)
     {
         foreach ($images as $key => $value) {
             if (Request::hasFile($key)) {
                 $image = Request::file($key);
                 $image->move($destinationPath . "/", $value);
             }
         }
     }
     $icons_touch_images_path = base_path() . '/public/img';
     $icons_touch_images = ['application_shortcut_icon_196x196' => 'shortcut-icon-196x196.png', 'application_favicon_ico_32x32' => 'shortcut-icon.ico', 'application_favicon_png_32x32' => 'shortcut-icon.png', 'apple_touch_icon_152x152' => 'apple-touch-icon.png', 'apple_touch_startup_image_640x920' => 'apple-touch-startup-image-640x920.png', 'apple_touch_startup_image_640x1096' => 'apple-touch-startup-image-640x1096.png', 'apple_touch_startup_image_750x1334' => 'apple-touch-startup-image-750x1334.png', 'apple_touch_startup_image_1242x2208' => 'apple-touch-startup-image-1242x2208.png', 'apple_touch_startup_image_1536x2008' => 'apple-touch-startup-image-1536x2008.png', 'company_logo' => 'company_logo.svg'];
     saveUploadedImages($icons_touch_images, $icons_touch_images_path);
     return redirect()->back();
 }
Example #2
0
 /**
  * Create the event handler.
  *
  * @return void
  */
 public function __construct()
 {
     $this->settings = ApplicationSetting::find(1);
 }
Example #3
0
 /**
  * Create a new controller instance.
  * 
  */
 public function __construct()
 {
     $this->user = $this->signedIn = Auth::user();
     $this->app_settings = ApplicationSetting::findOrFail(1);
     View::share('app_settings', $this->app_settings);
 }
Example #4
0
 public function run()
 {
     DB::table('application_settings')->delete();
     $data = ['name' => 'Sidequest', 'customer_support_email' => '*****@*****.**'];
     ApplicationSetting::create($data);
 }