Illuminate\Support\Facades\Facade::resolveFacadeInstance PHP Method

resolveFacadeInstance() protected static method

Resolve the facade root instance from the container.
protected static resolveFacadeInstance ( string | object $name ) : mixed
$name string | object
return mixed
    protected static function resolveFacadeInstance($name)
    {
        if (is_object($name)) {
            return $name;
        }
        if (isset(static::$resolvedInstance[$name])) {
            return static::$resolvedInstance[$name];
        }
        return static::$resolvedInstance[$name] = static::$app[$name];
    }

Usage Example

Exemplo n.º 1
0
 /**
  * {@inheritDoc}
  */
 protected static function resolveFacadeInstance($name)
 {
     if (!is_object($name) && !static::$app->bound($name) && ($instance = static::getFacadeInstance()) !== null) {
         static::$app->instance($name, $instance);
     }
     return parent::resolveFacadeInstance($name);
 }