update listener and add event provider

This commit is contained in:
Cüneyt Şentürk 2023-12-11 15:28:17 +03:00
parent be46caa086
commit b091d63560
2 changed files with 14 additions and 0 deletions

View File

@ -5,6 +5,7 @@ namespace App\Listeners\Update\V31;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Models\Common\Widget;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Str;
@ -28,11 +29,23 @@ class Version315 extends Listener
Log::channel('stdout')->info('Updating to 3.1.5 version...');
$this->clearCache();
$this->updateWidgets();
Log::channel('stdout')->info('Done!');
}
public function clearCache(): void
{
Log::channel('stdout')->info('Clearing cache...');
Artisan::call('view:clear');
Artisan::call('cache:clear');
Log::channel('stdout')->info('Cleared cache.');
}
public function updateWidgets()
{
Log::channel('stdout')->info('Updating widgets...');

View File

@ -27,6 +27,7 @@ class Event extends Provider
'App\Listeners\Update\V30\Version3016',
'App\Listeners\Update\V30\Version3017',
'App\Listeners\Update\V31\Version310',
'App\Listeners\Update\V31\Version315',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',