����JFIF��x�x����'
Server IP : 66.29.137.217 / Your IP : 18.227.49.178 Web Server : LiteSpeed System : Linux premium294.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : gltevjme ( 1095) PHP Version : 7.0.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/gltevjme/cbt.gltechlimited.com/app/Http/Controllers/ |
Upload File : |
<?php namespace App\Http\Controllers; use Illuminate\Support\Facades\DB; use Jackiedo\DotenvEditor\Exceptions\KeyNotFoundException; use Jackiedo\DotenvEditor\Facades\DotenvEditor; use Illuminate\Support\Facades\Artisan; class AppUpdateController extends Controller { public function __construct() { $this->middleware(['role:admin']); } /** * Update env file, configure storage and cache after update * The following logic may be different from version to version. * * @return \Illuminate\Http\RedirectResponse */ public function onSuccessfulUpdate() { //Check app is installed properly $installed = file_exists(storage_path('installed')); $env = DotenvEditor::load(); try { $currentVersion = $env->getValue('APP_VERSION'); } catch (KeyNotFoundException $exception) { return redirect()->back()->with('errorMessage', 'Unable to find current version. Please check APP_VERSION in .env file is set to the current version.'); } // check if app is already updated if($currentVersion == '1.4.1') { return redirect()->back()->with('successMessage', 'App is already up to date'); } $canUpdate = $currentVersion == '1.4.0'; // If installed and not updated, continue to update if($installed && $canUpdate) { //Update new app version $env->setKey('APP_VERSION', '1.4.1'); $env->save(); try { Artisan::call('config:clear'); Artisan::call('cache:clear'); Artisan::call('storage:link'); } catch (\Exception $exception) {} return redirect()->back()->with('successMessage', 'App Successfully Updated'); } return redirect()->back()->with('errorMessage', 'Nothing to update'); } }