Added update listener file..
This commit is contained in:
		
							
								
								
									
										43
									
								
								app/Listeners/Update/V30/Version3016.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										43
									
								
								app/Listeners/Update/V30/Version3016.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,43 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
namespace App\Listeners\Update\V30;
 | 
			
		||||
 | 
			
		||||
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 Version3016 extends Listener
 | 
			
		||||
{
 | 
			
		||||
    const ALIAS = 'core';
 | 
			
		||||
 | 
			
		||||
    const VERSION = '3.0.16';
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Handle the event.
 | 
			
		||||
     *
 | 
			
		||||
     * @param  $event
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function handle(Event $event)
 | 
			
		||||
    {
 | 
			
		||||
        if ($this->skipThisUpdate($event)) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        Log::channel('stdout')->info('Updating to 3.0.16 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.');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user