laravel/framework · error · Exception

Property [ ] does not exist on this collection instance.

Error message

Property [{$key}] does not exist on this collection instance.

What it means

Thrown by Collection::__get($key) when the accessed property is not one of the registered proxies (static::$proxies). Collection overloads dynamic property access to return HigherOrderCollectionProxy objects for keys like 'avg', 'count', 'map'; any other key throws a generic Exception. This is the magic-getter guard for the higher-order proxy feature.

Solutions

  1. Check the property name for typos and use a valid proxy or a real method call.
  2. If you wanted an item value, use ->get('key') or ->first()->key instead of property access.
  3. Refer to static::$proxies on your Collection class for the supported list in this version.

Example fix

// before
$titles = $collection->tittle;
// after
$titles = $collection->map->title;  // valid higher-order proxy
Defensive patterns

Strategy: validation

Validate before calling

$proxies = \Illuminate\Support\Collection::$proxies;
if (! in_array($key, $proxies, true)) {
    throw new \InvalidArgumentException("[$key] is not a valid collection proxy.");
}

Type guard

function isValidProxy(string $key): bool {
    return in_array($key, \Illuminate\Support\Collection::$proxies, true);
}

Try / catch

try {
    $proxy = $collection->{$key};
} catch (\Exception $e) {
    // not a proxy; fall back to a method call
    $proxy = null;
}

Prevention

When it happens

Trigger: $collection->someProperty where 'someProperty' is not in the proxies list (avg, count, each, every, first, flatMap, map, max, min, partition, reject, sortBy, sortByDesc, sum, take, tap, times, unique, unless, until, when).

Common situations: Typo accessing a real attribute as a property ($collection->tittle); expecting a model attribute on a collection; using a proxy name that doesn't exist in this version of Laravel.

Related errors


AI-assisted analysis of laravel/framework@e0f6eb3518 (2026-08-11). Data as JSON: /api/errors/a9bc624c9c4486c6. Report an issue: GitHub.

Appendix: source

Thrown at src/Illuminate/Collections/Traits/EnumeratesValues.php:1094

     * @return void
     */
    public static function proxy($method)
    {
        static::$proxies[] = $method;
    }

    /**
     * Dynamically access collection proxies.
     *
     * @param  string  $key
     * @return mixed
     *
     * @throws \Exception
     */
    public function __get($key)
    {
        if (! in_array($key, static::$proxies)) {
            throw new Exception("Property [{$key}] does not exist on this collection instance.");
        }

        return new HigherOrderCollectionProxy($this, $key);
    }

    /**
     * Results array of items from Collection or Arrayable.
     *
     * @param  mixed  $items
     * @return array<TKey, TValue>
     */
    protected function getArrayableItems($items)
    {
        return is_null($items) || is_scalar($items) || $items instanceof UnitEnum
            ? Arr::wrap($items)
            : Arr::from($items);
    }

View on GitHub (pinned to e0f6eb3518)