Skip to content

Commit ec63b8c

Browse files
authored
Fix #75
Don't know if its the right solution but it works.
1 parent 7bd4253 commit ec63b8c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/AttachMany.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public function __construct($name, $attribute = null, $resource = null)
5757

5858
// fetch the submitted values
5959
$values = json_decode(request()->input($attribute), true);
60+
61+
// if $values is null make it an empty array instead
62+
if (is_null($values)) {
63+
$values = [];
64+
}
6065

6166
// remove `null` values that may be submitted
6267
$filtered_values = array_filter($values);

0 commit comments

Comments
 (0)