kernel update

This commit is contained in:
2024-12-18 12:46:57 +03:00
parent 653e0bc983
commit 4ff9fa9ad3
56 changed files with 1023 additions and 84 deletions

View File

@ -5,17 +5,22 @@ namespace kernel\modules\post;
use kernel\helpers\Debug;
use kernel\Module;
use kernel\modules\menu\service\MenuService;
use kernel\services\MigrationService;
class PostModule extends Module
{
public MenuService $menuService;
public MigrationService $migrationService;
public function __construct()
{
$this->menuService = new MenuService();
$this->migrationService = new MigrationService();
}
public function init(): void
{
$this->migrationService->runAtPath("{KERNEL_MODULES}/post/migrations");
$this->menuService->createItem([
"label" => "Посты",
"url" => "/admin/post",
@ -26,5 +31,6 @@ class PostModule extends Module
public function deactivate(): void
{
$this->menuService->removeItemBySlug("post");
$this->migrationService->rollbackAtPath("{KERNEL_MODULES}/post/migrations");
}
}