I know collection doesn't support where LIKE but how can I achieve this.
collect($products)->where('name', 'LIKE', '%'. $productName . '%');
Laravel doesn't support where like in the collection. I'm thinking to use
collect($products)->filter( function () use ($productName) {
return preg_match(pattern, subject);
})
but I don't know how to do it. TY
via Rbex
