10000 Fix bug in Eloquent to_array method. · allforweb/laravel@f34063c · GitHub
[go: up one dir, main page]

Skip to content

Commit f34063c

Browse files
committed
Fix bug in Eloquent to_array method.
1 parent e804684 commit f34063c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

laravel/database/eloquent/model.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,8 @@ public function to_array()
617617
// to_array method, keying them both by name and ID.
618618
elseif (is_array($models))
619619
{
620+
$attributes[$name] = array();
621+
620622
foreach ($models as $id => $model)
621623
{
622624
$attributes[$name][$id] = $model->to_array();

0 commit comments

Comments
 (0)
0