public static function get($plugin = null)
    {
        $cacheKey = "get({$plugin})";
        $cache = static::cache($cacheKey);

        if ($cache !== null) {
            return $cache;
        }

        if ($plugin === null) {
            $collection = [];
            foreach ((array)quickapps('plugins') as $plugin) {
                $plugin = PackageFactory::create($plugin['name']);
                if ($plugin instanceof PluginPackage) {
                    $collection[] = $plugin;
                }
            }

            return static::cache($cacheKey, collection($collection));
        }

        $package = PackageFactory::create($plugin);
        if ($package instanceof PluginPackage) {
            return static::cache($cacheKey, $package);
        }

        throw new FatalErrorException(__d('cms', 'Plugin "{0}" was not found', $plugin));
    }