dont update newer versions

This commit is contained in:
Denis Duliçi
2022-03-02 12:02:34 +03:00
parent 2c86535d44
commit ea4a968f0f
3 changed files with 20 additions and 8 deletions

View File

@@ -2,6 +2,8 @@
namespace App\Abstracts\Listeners;
use App\Utilities\Versions;
abstract class Update
{
const ALIAS = '';
@@ -21,12 +23,7 @@ abstract class Update
return true;
}
// Do not apply to the same or newer versions
if (version_compare($event->old, static::VERSION, '>=')) {
return true;
}
return false;
return Versions::shouldUpdate(static::VERSION, $event->old, $event->new);
}
/**