Exemplo n.º 1
0
 public function saveDefaultPage(Request $request)
 {
     if (!Helper::getMode()) {
         return redirect()->back()->withErrors(config('constants.DISABLE_MESSAGE'));
     }
     $pages = Helper::getPages();
     $pages['homepage']['title'] = $request->input('homepage_title');
     $pages['homepage']['description'] = $request->input('homepage');
     $pages['business_hour']['title'] = $request->input('business_hour_title');
     $pages['business_hour']['description'] = $request->input('business_hour');
     $pages['terms_and_conditions']['title'] = $request->input('terms_and_conditions_title');
     $pages['terms_and_conditions']['description'] = $request->input('terms_and_conditions');
     $filename = base_path() . config('paths.PAGE_PATH');
     File::put($filename, var_export($pages, true));
     File::prepend($filename, '<?php return ');
     File::append($filename, ';');
     return redirect()->back()->withSuccess(config('constants.SAVED'));
 }