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

Any Ideas?

0

I'm not 100% clear on what symptoms you're experience that would suggest things are going poorly. However, almost all issues w/ retrieving incomplete data from model relationships for me occurs in how I set up those relationships. I took a peak at yours and you have all entities (Frames, Menus and Banners) pointing to each other with ->belongsToMany(). That may be correct, but I'd make sure that a ->hasMany() relationship isn't required for one of them, or a ->hasManyThrough().

Perhaps you could share your db schema.

Also, if you've set your schema up using standard naming conventions, all you need is ->belongsToMany('Menu'), instead of passing all those arguments in ->belongsToMany('Menu', 'banner_menu', etc, etc). It appears as though you've used standard naming conventions.

0

yes, it may be a foreign key issue, or a eloquent relationship problem, post ur schema related to the models

0

Sign in to participate in this thread!

Eventy

Your banner here too?

shiva shiva Joined 24 Jul 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.