I've been working on a Slim 2 and have just recently started deploying to a production server. Everything seems to be working okay so far. I'm able to log in so I know that I'm connecting to the database just fine. It recognized who I'm logged in as recognized what permissions I have as this user. I have another table with several entries. When I do...
$collection = collect($app->item->where('user_id', $userId)->get());
and then...
print_r($collection);
on the production server, I see the whole collection just like I do on the development server, but when I add...
$pack = $collection->where('status', 1);
and instead of printing the collection, try to print the pack like...
print_r($pack);
this message comes back...
Illuminate\Support\Collection Object ( [items:protected] => Array ( ) )
where on the development version I get the filtered collection as I would expect. How can I alter the code to work in both development and production environments?
Most likely you don't have records in the production database with a status of 1 and you do have records with a status of 1 in development.
Check the database directly in production to verify.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With