<?php
/*
 * Copyright (c) 2023.
 *
 * A.Сапаргалиев
 * ТОО "Дизайн лаборатория А7"
 * Астана
 */

namespace App\Modules\Home\Commands;

use A7kz\Platform\Commands\InstallCommand;
use A7kz\Platform\Modules\Platform\Acl\Facades\Acl;
use A7kz\Platform\Modules\Platform\Core\Facades\Core;

class HomeInstallCommand extends InstallCommand
{
    protected $signature = "home:install {--install} {--upgrade} {--apps}";
    protected $description = "Главная страница";
    protected $module_name = "home";
    protected $module_version = "1.0.0";

    public function seeds(): void
    {
        Acl::addRoleAction("guest","app.home");
        Acl::addRoleAction("user","app.home");
    }

    public function apps(): void
    {
        Core::registerApp(
            "app.home",
            json_encode([
                "name"=>"app.home",
                "title"=>"Home",
                "type"=>"custom",
                "class"=>"App.Modules.Home.Applications.Home",
                "module"=>"App.Modules.Home"
            ]),
            "Главная страница",
            '[]'
        );
    }
}
