public static function add($pkCategoryHandle, $pkHandle, $pkName, $pkDescription, $pkCanTriggerWorkflow, $pkHasCustomClass, $pkg = false)
    {
        $app = Application::getFacadeApplication();
        $db = $app->make(Connection::class);

        $pkCategoryID = $db->fetchColumn('select pkCategoryID from PermissionKeyCategories where pkCategoryHandle = ?', [$pkCategoryHandle]);
        $db->insert('PermissionKeys', [
            'pkHandle' => $pkHandle,
            'pkName' => $pkName,
            'pkDescription' => $pkDescription,
            'pkCategoryID' => $pkCategoryID,
            'pkCanTriggerWorkflow' => $pkCanTriggerWorkflow ? 1 : 0,
            'pkHasCustomClass' => $pkHasCustomClass ? 1 : 0,
            'pkgID' => is_object($pkg) ? $pkg->getPackageID() : 0,
        ]);
        $pkID = $db->lastInsertId();
        $keys = self::loadAll();

        return $keys[$pkID];
    }