improved updates

This commit is contained in:
denisdulici
2017-10-02 16:26:45 +03:00
parent a4c377b38e
commit ef7fafbe79
11 changed files with 155 additions and 57 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Listeners\Updates;
class Listener
{
const ALIAS = '';
const VERSION = '';
/**
* Check if should listen.
*
* @param $event
* @return boolean
*/
protected function check($event)
{
// Apply only to the specified alias
if ($event->alias != self::ALIAS) {
return false;
}
// Do not apply to the same or newer versions
if ($event->old >= self::VERSION) {
return false;
}
return true;
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Listeners\Updates;
//use App\Models\Auth\Permission;
use App\Events\UpdateFinished;
class Version104 extends Listener
{
const ALIAS = 'core';
const VERSION = '1.0.4';
/**
* Handle the event.
*
* @param $event
* @return void
*/
public function handle(UpdateFinished $event)
{
// Check if should listen
if (!$this->check($event)) {
return;
}
/*Permission::create([
'name' => 'john-doe',
'display_name' => 'John Doe',
'description' => 'John Doe',
]);*/
}
}