<?php
namespace App\Lib;

class Constants {
    public const MENUS = [
        'sertifikat-vaksin',
        'user',
        'nama-vaksin',
        'tahap-vaksin',
        'profile'
    ];

    public const BASE_ACTIONS = [
        'index',
        'create',
        'read',
        'update',
        'delete',
        'print'
    ];

    public const CUSTOM_MENU_ACTIONS = [
        'dashboard.index',
    ];

    public const ADMIN_ACTIONS = [

    ];

    public static function getMenuActions($menus = null, $actions = null)
    {
        $routes = [];
        $menus = !is_null($menus) ? $menus : Constants::MENUS;
        $actions = !is_null($actions) ? $actions : Constants::BASE_ACTIONS;

        foreach($menus as $menu) {
            foreach(Constants::BASE_ACTIONS as $action) {
                $routes[] = $menu.'.'.$action;
            }
        }

        return $routes;
    }
}
