Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't know if its the right solution but it works.
  • Loading branch information
MPaap authored Jan 7, 2021
1 parent 7bd4253 commit ec63b8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/AttachMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ public function __construct($name, $attribute = null, $resource = null)

// fetch the submitted values
$values = json_decode(request()->input($attribute), true);

// if $values is null make it an empty array instead
if (is_null($values)) {
$values = [];
}

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

0 comments on commit ec63b8c

Please sign in to comment.