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

I'm not totally sure if I get what you mean but you could try eager loading (as long as your providers have relationships defined to the other models):

$providers = Provider::with('countries', 'states', 'cities')->get();

Or do you absolutely need the columns to be named cname, sname etc?

0

Thanks, i'll try your code. I need a row of provider table and plus the column 'name' of the table city, state and country. cname, sname and ciname are alias for to have a unique name for each column, beacuse i already have a column named 'name' in provider table.

What exactly are doing the code you post over there? Returning one row or set of them?

Thanks!

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

luchos297 luchos297 Joined 2 Sep 2015

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.