To explain this question better I'll just give an example:
Let's say I have a world records database and wish to create an api for it. Let's say I want to add a search
route that takes in GET
or POST
parameters (let's keep it simple and just say GET
for now). Is it possible to write a search
controller method which uses something like an array as a parameter to Eloquent's where
method while also utilizing a like
parameter (MySQL LIKE
)?
I have the following which works but only for exact values:
public function search()
{
$params = Input::all();
return Records::where($params)->get();
}