jeudi 28 juillet 2016

Issue with Laravel Eloquent Collections

This is my first question here, thanks in advance for your help.

Lets see if I can explain this issue. I am doing an eloquent query to get some registers from the database and then query this collection to get specific ones. I am running this on two servers:

Server 1: PHP 5.4.42

Server 2: PHP 5.4

The app is running on Laravel 5.0

The issue is on the second "print_r"

$data_all = ContentView::whereIn("id", array(1,2,3,4,5,6,7,8,9,10))->where("status", true)->where("lang", App::getLocale())->get();

print_r ($data_all); // This is working fine the collection is returned with all ids and data in both servers
print_r($data_all->where("id", 3)->first()); // This is not working on server 2
print_r($data_all->find(3)); // This is working fine in both servers

I have been using the "where" way so many times on the code and can not find out why is not returnig any values (or errors).

Do I need to check any php extension for this method to work?

Any suggestions?

Thanks!



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2aiXPof
via IFTTT

Aucun commentaire:

Enregistrer un commentaire