diff --git a/src/Illuminate/Http/Resources/DelegatesToResource.php b/src/Illuminate/Http/Resources/DelegatesToResource.php index 036a143100e5..401ba9215ef0 100644 --- a/src/Illuminate/Http/Resources/DelegatesToResource.php +++ b/src/Illuminate/Http/Resources/DelegatesToResource.php @@ -50,7 +50,7 @@ public function resolveRouteBinding($value) */ public function offsetExists($offset) { - return isset($this->resource[$offset]); + return (is_array($offset) || $offset instanceof ArrayAccess) && isset($this->resource[$offset]); } /**