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

I highly suggest you watch some of the laracast before you proceed any further. another good tutorial is this ==https://scotch.io/tutorials/a-guide-to-using-eloquent-orm-in-laravel

Last updated 9 years ago.
0

jimgwhit said:

I highly suggest you watch some of the laracast before you proceed any further. another good tutorial is this ==https://scotch.io/tutorials/a-guide-to-using-eloquent-orm-in-laravel

Thank you for answer!

I have read this link.

I konw how to use one-to-one ,one-to-many and one-to-many.

About This question I connect A and B by primary key, but add D and not use primary key.I try to do it by hasManyThrough, but must use primary key.

example:

table event(id, name), eventInfo(id, event_id, user_id, ......), user(id, name), userInfo(id, user_id, ......).

I want to get some data from userInfo by select event, but just have uer_id at eventInfo.

what method can do it?

Last updated 9 years ago.
0

I still think you need a foreign key but please read and study this post real good. http://laravel.io/forum/05-12-2015-has-many-through-relationship-depth

0

jimgwhit said:

I still think you need a foreign key but please read and study this post real good. http://laravel.io/forum/05-12-2015-has-many-through-relationship-depth

hi jimgwhit :

Thank you for help .

0

Sign in to participate in this thread!

Eventy

Your banner here too?

shuli1984 shuli1984 Joined 7 May 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.