File tree 3 files changed +7
-5
lines changed
3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -10,16 +10,16 @@ class DatabaseReminderRepository extends \Illuminate\Auth\Reminders\DatabaseRemi
10
10
*/
11
11
protected function reminderExpired ($ reminder )
12
12
{
13
- // Convert to object so that we can pass it to the parent method
14
- if (is_array ($ reminder ))
13
+ // Convert to array so that we can pass it to the parent method
14
+ if (is_object ($ reminder ))
15
15
{
16
- $ reminder = (object ) $ reminder ;
16
+ $ reminder = (array ) $ reminder ;
17
17
}
18
18
19
19
// Convert the DateTime object that got saved to MongoDB
20
- if (is_array ($ reminder-> created_at ))
20
+ if (is_array ($ reminder[ ' created_at ' ] ))
21
21
{
22
- $ reminder-> created_at = $ reminder-> created_at ['date ' ] + $ reminder-> created_at ['timezone ' ];
22
+ $ reminder[ ' created_at ' ] = $ reminder[ ' created_at ' ] ['date ' ] + $ reminder[ ' created_at ' ] ['timezone ' ];
23
23
}
24
24
25
25
return parent ::reminderExpired ($ reminder );
Original file line number Diff line number Diff line change @@ -487,6 +487,7 @@ protected function toCollection(array $results = array())
487
487
488
488
// Attatch the parent relation to the embedded model.
489
489
$ model ->setRelation ($ this ->foreignKey , $ this ->parent );
490
+ $ model ->setHidden (array_merge ($ model ->getHidden (), array ($ this ->foreignKey )));
490
491
491
492
$ models [] = $ model ;
492
493
}
Original file line number Diff line number Diff line change @@ -337,6 +337,7 @@ public function testEmbedsManySave()
337
337
$ this ->assertInstanceOf ('DateTime ' , $ address ->created_at );
338
338
$ this ->assertInstanceOf ('DateTime ' , $ address ->updated_at );
339
339
$ this ->assertInstanceOf ('User ' , $ address ->user );
340
+ $ this ->assertEmpty ($ address ->relationsToArray ()); // prevent infinite loop
340
341
341
342
$ user = User::find ($ user ->_id );
342
343
$ user ->addresses ()->save (new Address (array ('city ' => 'Bruxelles ' )));
You can’t perform that action at this time.
0 commit comments