FEATURE: add enumeration for translating module handlers for their ids
This feature will need bit more optimalization. This is somehow weird approach.
This commit is contained in:
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Enumerations;
|
||||||
|
|
||||||
|
use App\Models\Module;
|
||||||
|
|
||||||
|
class ModulesHandlerToId extends BaseEnumeration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Init list of all installed modules
|
||||||
|
*
|
||||||
|
* @throws Exceptions\EnumerationExistsException
|
||||||
|
*/
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
$modules = Module::all(['handler', 'id']);
|
||||||
|
|
||||||
|
foreach ($modules as $module) {
|
||||||
|
self::push($module->handler, $module->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user