diff --git a/CHANGELOG.md b/CHANGELOG.md index bc7c249..2bb75fe 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## 4.5.1 - 2024.9.24 +### Fixed +* The `whereIn` and `whereNotIn` argument methods now are case-insensitive + ## 4.5.0 - 2024.9.24 ### Added * Assets are uploaded to the currently selected album diff --git a/composer.json b/composer.json index 5b55eac..1b0ab4f 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "lsst-epo/canto-dam-assets", "description": "This Craft CMS plugin adds a Field Type with GraphQL support for the Canto Digital Asset Management (DAM) web system", "type": "craft-plugin", - "version": "4.5.0", + "version": "4.5.1", "license": "MIT", "require": { "php": ">=8.0.2", diff --git a/src/lib/laravel/Collection.php b/src/lib/laravel/Collection.php index 9bffb77..83f0ace 100644 --- a/src/lib/laravel/Collection.php +++ b/src/lib/laravel/Collection.php @@ -76,7 +76,7 @@ public function whereIn($key, $values, $strict = false) $item = data_get($item, $key); // Handle the case where the data is an array of items if (is_array($item)) { - return count(array_intersect($item, $values)) > 0; + return count(array_intersect(array_map('strtolower', $item), array_map('strtolower', $values))) > 0; } return in_array($item, $values, $strict); }); @@ -98,7 +98,7 @@ public function whereNotIn($key, $values, $strict = false) $item = data_get($item, $key); // Handle the case where the data is an array of items if (is_array($item)) { - return count(array_intersect($item, $values)) > 0; + return count(array_intersect(array_map('strtolower', $item), array_map('strtolower', $values))) > 0; } return in_array($item, $values, $strict); });