diff --git a/resources/views/grid/selector.blade.php b/resources/views/grid/selector.blade.php
index d2d33fb21..bcddef79f 100644
--- a/resources/views/grid/selector.blade.php
+++ b/resources/views/grid/selector.blade.php
@@ -6,7 +6,7 @@
@foreach($selector['options'] as $value => $option)
@php
- $active = in_array($value, \Illuminate\Support\Arr::get($selected, $column, []));
+ $active = in_array((string) $value, \Illuminate\Support\Arr::get($selected, $column, []), true);
@endphp
-
selected = $selected;
@@ -182,8 +186,8 @@ public function url($column, $value = null, $add = false)
return $this->request->fullUrlWithQuery($query);
}
- if (in_array($value, $options)) {
- Helper::deleteByValue($options, $value);
+ if (in_array((string) $value, $options, true)) {
+ Helper::deleteByValue($options, (string) $value, true);
} else {
if ($add) {
$options = [];
diff --git a/src/Support/Helper.php b/src/Support/Helper.php
index 61a6ab556..27988f52c 100755
--- a/src/Support/Helper.php
+++ b/src/Support/Helper.php
@@ -417,13 +417,14 @@ public static function exportArrayPhp(array $array)
*
* @param array $array
* @param mixed $value
+ * @param bool $strict
*/
- public static function deleteByValue(&$array, $value)
+ public static function deleteByValue(&$array, $value, bool $strict = false)
{
$value = (array) $value;
foreach ($array as $index => $item) {
- if (in_array($item, $value)) {
+ if (in_array($item, $value, $strict)) {
unset($array[$index]);
}
}