Update Cache, prepare for laravel 5.8

This commit is contained in:
Daniel Supernault 2019-02-25 11:56:24 -07:00
parent 6bbef6ac4e
commit 4739c25fe0
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7
15 changed files with 31 additions and 30 deletions

View file

@ -36,16 +36,16 @@ trait AdminSettingsController
public function settingsStorage(Request $request)
{
$databaseSum = Cache::remember('admin:settings:storage:db:storageUsed', 360, function() {
$databaseSum = Cache::remember('admin:settings:storage:db:storageUsed', now()->addMinutes(360), function() {
$q = 'SELECT sum(ROUND(((data_length + index_length)), 0)) AS size FROM information_schema.TABLES WHERE table_schema = ?';
$db = config('database.default');
$db = config("database.connections.{$db}.database");
return DB::select($q, [$db])[0]->size;
});
$mediaSum = Cache::remember('admin:settings:storage:media:storageUsed', 360, function() {
$mediaSum = Cache::remember('admin:settings:storage:media:storageUsed', now()->addMinutes(360), function() {
return Media::sum('size');
});
$backupSum = Cache::remember('admin:settings:storage:backups:storageUsed', 360, function() {
$backupSum = Cache::remember('admin:settings:storage:backups:storageUsed', now()->addMinutes(360), function() {
$dir = storage_path('app/'.config('app.name'));
$size = 0;
foreach (glob(rtrim($dir, '/').'/*', GLOB_NOSORT) as $each) {