# Redis Prefix Analyzer PRO

Category Severity Time To Fix
✅ Reliability Major 1 minute

Class: Enlightn\EnlightnPro\Analyzers\Reliability\RedisPrefixAnalyzer

# Introduction

laravel_database_ is the default Redis prefix for all Laravel applications. If you share the same Redis servers for multiple applications, this may result in a collision with other applications.

# How To Fix

To avoid a collision with other applications that share the same Redis servers, you may modify the Redis default prefix in your config/database.php file or the corresponding REDIS_PREFIX env variable:

'redis' => [

        'client' => env('REDIS_CLIENT', 'phpredis'),

        'options' => [
            'cluster' => env('REDIS_CLUSTER', 'redis'),
            'prefix' => env('REDIS_PREFIX', 'myappname_database_'),
        ],
        
        ...
],

It is also a good practice to use separate Redis databases when sharing the same Redis servers.

# Skip Condition

This analyzer is skipped if your application does not use Redis.

# References