Hey,
I am working on a site that shows the latest movies to watch, the problem is that when people search they want relevant results with images,
some movies and tv shows don't have an poster which means it's not gonna be relevant.
So here we have an normal JSON
[
{
"name": "whatever",
"poster_path":"\/ekZobS8isE6mA53RAiGDG93hBxL.jpg",
},
{
"name": "irrelevant",
}
]
So I convert it to collection using "collect()" then I am not sure how to exclude all of the ones that don't have poster_path key!
I am thinking it's the function "where" but I can't seem to get it working!
Here is my code!
collect(Tmdb::search()->multi()->query($request->input('query'))->get()["results"]) // ->where()....
If you know the answer please help, thanks in advance!