Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

Solution to this question is, DRUM ROLL, TA-DA!

$authors = Authors::whereIn("id", array(1))->with('books')->get()->toJson();
print_r($authors);

This allows me to display the author and group there books in a json format. yay me!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.