added listener update

This commit is contained in:
Cihan Şentürk 2024-12-31 20:39:49 +03:00
parent dd60498804
commit aa5bb91e61
2 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,43 @@
<?php
namespace App\Listeners\Update\V31;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
class Version3115 extends Listener
{
const ALIAS = 'core';
const VERSION = '3.1.15';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
Log::channel('stdout')->info('Updating to 3.1.15 version...');
$this->updateDatabase();
Log::channel('stdout')->info('Done!');
}
public function updateDatabase(): void
{
Log::channel('stdout')->info('Updating database...');
Artisan::call('migrate', ['--force' => true]);
Log::channel('stdout')->info('Database updated.');
}
}

View File

@ -31,6 +31,7 @@ class Event extends Provider
'App\Listeners\Update\V31\Version317',
'App\Listeners\Update\V31\Version318',
'App\Listeners\Update\V31\Version3112',
'App\Listeners\Update\V31\Version3115',
],
'Illuminate\Routing\Events\PreparingResponse' => [
'App\Listeners\Common\PreparingResponse',