mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 21:44:51 +00:00
Set app version on install and updates
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace App\Space;
|
||||
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use League\Flysystem\FilesystemException;
|
||||
|
||||
@@ -89,4 +91,18 @@ class InstallUtils
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the app version
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function setCurrentVersion()
|
||||
{
|
||||
$version = preg_replace('~[\r\n]+~', '', File::get(base_path('version.md')));
|
||||
if (! $version) {
|
||||
return;
|
||||
}
|
||||
Setting::setSetting('version', $version);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user