mirror of
https://github.com/AnimeThemes/animethemes-server.git
synced 2026-07-11 01:24:46 +02:00
19 lines
614 B
PHP
19 lines
614 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Concerns;
|
|
|
|
trait DetectsRedis
|
|
{
|
|
protected function appUsesRedis(): bool
|
|
{
|
|
// We assume here that if the cache, session, broadcasting or queue is powered by Redis,
|
|
// then the application is using Redis.
|
|
return config('cache.stores.'.config('cache.default').'.driver') === 'redis'
|
|
|| config('broadcasting.connections.'.config('broadcasting.default').'.driver') === 'redis'
|
|
|| config('session.driver') === 'redis'
|
|
|| config('queue.connections.'.config('queue.default').'.driver') === 'redis';
|
|
}
|
|
}
|