-
-
Notifications
You must be signed in to change notification settings - Fork 408
Description
PHP Version: 8.0.25
Laravel Version: 9.41.0
Query Builder Version: 5.1.0
After updating from v5.0.3 to v5.1.0, all of my tests with this package broke, with the below exception:
This is because several of my filters contain multi-dimensional associative arrays, and not just key-value pairs.
For further context, we've built a condition system with this package. Dumping $value here:
laravel-query-builder/src/AllowedFilter.php
Lines 155 to 159 in 09d2251
| if (is_array($value)) { | |
| $remainingProperties = array_diff($value, $this->ignored->toArray()); | |
| return ! empty($remainingProperties) ? $remainingProperties : null; | |
| } |
Results in:
array:1 [▼
0 => array:2 [▼
"attribute" => "name"
"operator" => "equals"
"value" => "John Doe"
]
]However, it appears array_diff does not support multi-dimensional arrays, breaking the value resolution function and throwing the above exception.
Let me know if you require further information. I'll work on a PR in the meantime, along with a test case.
