private function generateGlobalThumb($id)
    {
        $resource = HCResources::find($id);

        if( ! file_exists(storage_path('app/') . $resource->path) )
            return;

        if( strpos($resource->mime_type, 'image') === false || strpos($resource->mime_type, 'svg') !== false )
            return;

        if( ! $resource )
            throw new \Exception('Resource not found: ' . $id);

        $thumbRules = HCThumbs::where('global', 1)->get();
        $dest = implode('/', str_split(str_pad($resource->count, 9, '0', STR_PAD_LEFT), 3)) . '/';

        foreach ( $thumbRules as $rule ) {
            $destination = generateResourcePublicLocation($dest, $rule->width, $rule->height, $rule->fit) . $resource->extension;
            createImage(storage_path('app/') . $resource->path, $destination, $rule->width, $rule->height, $rule->fit);
        }
    }