Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 2 years ago.
0

The way you query is not correct. This is the way the relations are stated.

http://laravel.com/docs/eloquent#one-to-many

Check the example there, you should query it differently, according to your model.

Regards,

Last updated 2 years ago.
0

Use var_dump($results) or dd($results) (var_dump and die) or use my debugbar: https://github.com/barryvdh/laravel-debugbar

Debugbar::info($results);

You would then see you don't have a collection, but a relation/query or something. Probably needs ->get()

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

flim flim Joined 15 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.