master

laravel/framework

Last updated at: 29/12/2023 09:21

Factory.php

TLDR

The Factory interface in the Illuminate\Contracts\Redis namespace provides a method for getting a Redis connection by name.

Methods

connection

This method retrieves a Redis connection by name.

Parameters

  • $name (string|null): The name of the Redis connection. If no name is specified, the default connection will be used.

Return type

  • \Illuminate\Redis\Connections\Connection: The Redis connection.
<?php

namespace Illuminate\Contracts\Redis;

interface Factory
{
    /**
     * Get a Redis connection by name.
     *
     * @param  string|null  $name
     * @return \Illuminate\Redis\Connections\Connection
     */
    public function connection($name = null);
}