dd($sale->groups->toArray());
Does that result in an empty array too?
Yes, i have the good result. But i want to get all the objects "group", and with this code, i get only the attributes into an array...
Remove ->toArray()
then.
The difference is basically ->groups()
and ->groups
. One is the collection/model, the other is the data. I think it's the data you want. Unfiltered, so no ->toJson()
or ->toArray()
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community