This feature will need bit more optimalization. This is somehow weird approach.
21 lines
435 B
PHP
21 lines
435 B
PHP
<?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);
|
|
}
|
|
}
|
|
} |