keys('*:laravel*'); foreach ($keys as $key) { $keyWithoutPrefix = str_replace($prefix, '', $key); Redis::connection()->del($keyWithoutPrefix); } } }