Laravel 5.5 Collection where like
问题 i am filtering data using collections. But i need to use like method. I had tried to write like this : ('name', 'LIKE', '%value%') but it did not work. Here is my method : protected function filterData(Collection $collection, $transformer) { foreach (request()->query() as $query => $value) { $attribute = $transformer::originalAttribute($query); if (isset($attribute, $value)) { $collection = $collection->where($attribute, $value); } } return $collection; } 回答1: The 1st question is whether you