I'm using Laravel 5.1 and its Eloquent model with mysql.
But I would like to populate a collection of models fetching a static array and then querying it as normal. So let's say I have my Photo model and I would query it as usual:
App\Photo::where('published', 1)->get();
But the Photo model should fetch not a DB table but an array like this:
$photos = [
[ "id" => 1, "published" => 1 ],
[ "id" => 2, "published" => 1 ],
[ "id" => 2, "published" => 0 ],
]
My problem is to link this array to that model before querying it. Any ideas?