\Helper::getAllLocales(), ]; //$filesystem = new Filesystem(); //$file_path = public_path('js/vars.js'); $file_path = storage_path('app/public/js/vars.js'); $content = view('js/vars', $params)->render(); //$filesystem->put($file_path, $content); // Save vars only if content changed try { if (\Storage::exists('js/vars.js')) { $old_content = \Storage::get('js/vars.js'); if ($content != $old_content) { \Storage::put('js/vars.js', $content); } } else { \Storage::put('js/vars.js', $content); } $this->info("Created: ".substr($file_path, strlen(base_path())+1)); } catch (\Exception $e) { $msg = "Error occurred saving /storage/app/public/js/vars.js. ".\Helper::formatException($e); \Log::error($msg); $this->error($msg); } } catch (\Exception $e) { $this->error($e->getMessage()); } } }