protected function generateCachePath(
        string $resourceId,
        string $disk,
        string $extension,
        int $width = 0,
        int $height = 0,
        $fit = null
    ): string {
        if ($this->isLocalOrPublic($disk)) {
            $folder = config('filesystems.disks.' . $disk . '.root') . '/cache/' . str_replace('-', '/', $resourceId);

            if (!is_dir($folder)) {
                mkdir($folder, 0755, true);
            }
        }

        $path = 'cache/' . str_replace('-', '/', $resourceId) . '/';

        $path .= $width . '_' . $height;

        if ($fit) {
            $path .= '_fit';
        }

        return $path . $extension;
    }
protected function generateCachePath(
        string $resourceId,
        string $disk,
        string $extension,
        int $width = 0,
        int $height = 0,
        $fit = null
    ): string {
        if ($this->isLocalOrPublic($disk)) {
            $folder = config('filesystems.disks.' . $disk . '.root') . '/cache/' . str_replace('-', '/', $resourceId);

            if (!is_dir($folder)) {
                mkdir($folder, 0755, true);
            }
        }

        $path = 'cache/' . str_replace('-', '/', $resourceId) . '/';

        $path .= $width . '_' . $height;

        if ($fit) {
            $path .= '_fit';
        }

        return $path . $extension;
    }
protected function generateCachePath ( string $ resourceId , string $ disk , string $ extension , int $ width = 0 , int $ height = 0 , $ fit = null ) : string { if ( $ this -> isLocalOrPublic ( $ disk ) ) { $ folder = config ( 'filesystems.disks.' . $ disk . '.root' ) . '/cache/' . str_replace ( '-' , '/' , $ resourceId ) ; if ( ! is_dir ( $ folder ) ) { mkdir ( $ folder , 0755 , true ) ; } } $ path = 'cache/' . str_replace ( '-' , '/' , $ resourceId ) . '/' ; $ path .= $ width . '_' . $ height ; if ( $ fit ) { $ path .= '_fit' ; } return $ path . $ extension ; }
Generating resource cache location and name

@param string $resourceId
@param string $disk
@param string $extension
@param int|null $width
@param int|null $height
@param null $fit
@return string
Generating resource cache location and name