I have the following array:
$elements = collect([
['product_id' => 'prod-100', 'name' => 'Desk'],
['product_id' => 'prod-200', 'name' => 'Chair'],
]);
I need to filter by approximation, but just using the collection data, something like:
$elements->where('name', 'LIKE', 'De%')->values()->all();
Actually i can filter the data, but with a normal filter (where), this does not work for me because it find the exact coincidences. So, if i use a normal filter i have to say the exactly value to match:
$elements->where('name', 'Desk');
How i can made a query to the array data using something like a "Where LIKE" clausule?