swayok / alternative-laravel-cache

Replacements for Laravel's redis and file cache stores that properly implement tagging idea
MIT License
169 stars 26 forks source link

Fix bug that occurs when trying to set an empty prefix with 'prefix'=>'' #53

Closed Macek007 closed 2 months ago

Macek007 commented 2 months ago

I tried to set an empty prefix for the altfile driver, but it didn't work.

Below is the relevant configuration from config/cache.php:

'altfile' => [
            'driver' => 'altfile',
            'path' => storage_path('framework/cache/data'),
            'lock_path' => storage_path('framework/cache/data'),
            'prefix' => '',
        ],

However, despite this configuration, the default prefix from Laravel was still applied:

      'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
swayok commented 2 months ago

Thanks for the fix. Published in version 6.1.16