Files
core/modules/Blog/Comments/Handlers/Comments.php
T

37 lines
968 B
PHP

<?php
namespace Modules\Blog\Comments\Handlers;
use App\Enumerations\ModulesHandlerToId;
use App\Handlers\BaseHandler;
use App\Models\User;
class Comments extends BaseHandler
{
public static function getModuleId()
{
$handler = config('comments.handler');
$allModules = ModulesHandlerToId::getWithTranslations();
$moduleId = isset($allModules[$handler]) ? $allModules[$handler] : null;
return $moduleId;
}
/**
* Install module
*
* @return mixed
*/
public static function install()
{
// nothing to do
}
public static function registerAdminMenu(User $user)
{
$menu = \Menu::instance('mainMenu');
$menu->dropdown(trans('comments::module.name'), function ($sub) {
$sub->route('comments.overview', trans('comments::module.overview'), [], 10, ['icon' => 'fa fa-fw fa-commenting-o']);
}, 10, ['icon' => 'fa fa-fw fa-comments-o']);
}
}