Skip to content

Commit a8dc4d3

Browse files
Updated WebPushMessage->toArray() to make it compatible with Laravel 5.0+
1 parent 89b9f2f commit a8dc4d3

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

src/WebPushMessage.php

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -245,27 +245,6 @@ public function data($value)
245245
*/
246246
public function toArray()
247247
{
248-
return collect([
249-
'title',
250-
'actions',
251-
'badge',
252-
'body',
253-
'dir',
254-
'icon',
255-
'image',
256-
'lang',
257-
'renotify',
258-
'requireInteraction',
259-
'tag',
260-
'vibrate',
261-
'data',
262-
])
263-
->mapWithKeys(function ($option) {
264-
return [$option => $this->{$option}];
265-
})
266-
->reject(function ($value) {
267-
return is_null($value);
268-
})
269-
->toArray();
248+
return array_filter(get_object_vars($this));
270249
}
271250
}

0 commit comments

Comments
 (0)