{"record":{"id":"a9bc624c9c4486c6","repo":"laravel/framework","slug":"property-key-does-not-exist-on-this-collectio","errorCode":null,"errorMessage":"Property [{$key}] does not exist on this collection instance.","messagePattern":"Property \\[(.+?)\\] does not exist on this collection instance\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Illuminate/Collections/Traits/EnumeratesValues.php","lineNumber":1094,"sourceCode":"     * @return void\n     */\n    public static function proxy($method)\n    {\n        static::$proxies[] = $method;\n    }\n\n    /**\n     * Dynamically access collection proxies.\n     *\n     * @param  string  $key\n     * @return mixed\n     *\n     * @throws \\Exception\n     */\n    public function __get($key)\n    {\n        if (! in_array($key, static::$proxies)) {\n            throw new Exception(\"Property [{$key}] does not exist on this collection instance.\");\n        }\n\n        return new HigherOrderCollectionProxy($this, $key);\n    }\n\n    /**\n     * Results array of items from Collection or Arrayable.\n     *\n     * @param  mixed  $items\n     * @return array<TKey, TValue>\n     */\n    protected function getArrayableItems($items)\n    {\n        return is_null($items) || is_scalar($items) || $items instanceof UnitEnum\n            ? Arr::wrap($items)\n            : Arr::from($items);\n    }\n","sourceCodeStart":1076,"sourceCodeEnd":1112,"githubUrl":"https://github.com/laravel/framework/blob/e0f6eb3518ac29fbbca8529e97d0df7fc9f24481/src/Illuminate/Collections/Traits/EnumeratesValues.php#L1076-L1112","documentation":"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.","triggerScenarios":"$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).","commonSituations":"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.","solutions":["Check the property name for typos and use a valid proxy or a real method call.","If you wanted an item value, use ->get('key') or ->first()->key instead of property access.","Refer to static::$proxies on your Collection class for the supported list in this version."],"exampleFix":"// before\n$titles = $collection->tittle;\n// after\n$titles = $collection->map->title;  // valid higher-order proxy","handlingStrategy":"validation","validationCode":"$proxies = \\Illuminate\\Support\\Collection::$proxies;\nif (! in_array($key, $proxies, true)) {\n    throw new \\InvalidArgumentException(\"[$key] is not a valid collection proxy.\");\n}","typeGuard":"function isValidProxy(string $key): bool {\n    return in_array($key, \\Illuminate\\Support\\Collection::$proxies, true);\n}","tryCatchPattern":"try {\n    $proxy = $collection->{$key};\n} catch (\\Exception $e) {\n    // not a proxy; fall back to a method call\n    $proxy = null;\n}","preventionTips":["Use real method calls (->map(...)) over dynamic proxy access where possible.","Refer to static::$proxies for the valid keys in your Laravel version.","Lint/IDE-helper the Collection to surface unknown properties."],"tags":["collections","magic-methods","laravel","typo"],"backgroundTag":null,"analyzedSha":"e0f6eb3518ac29fbbca8529e97d0df7fc9f24481","analyzedAt":"2026-08-11T20:52:37.562Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}