Skip to content

Relationship Model Cant Connect Another Table #1331

Closed Answered by lrljoe
kahfieidn asked this question in Q&A
Discussion options

You must be logged in to vote

Get rid of the $model reference as that is the alternative approach, and it is

public function builder(): Builder

not

public function query(): Builder

Then add the id for your relationship in setAdditionalSelects in your configure() method. You'll need to prefix it with the table name in your database.

Replies: 3 comments 8 replies

Comment options

lrljoe
Sep 3, 2023
Collaborator Sponsor

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

lrljoe
Sep 3, 2023
Collaborator Sponsor

You must be logged in to vote
8 replies
@kahfieidn
Comment options

@lrljoe
Comment options

lrljoe Sep 4, 2023
Collaborator Sponsor

@kahfieidn
Comment options

@lrljoe
Comment options

lrljoe Sep 4, 2023
Collaborator Sponsor

Answer selected by kahfieidn
@kahfieidn
Comment options

@lrljoe
Comment options

lrljoe Sep 4, 2023
Collaborator Sponsor

@kahfieidn
Comment options

@kahfieidn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1330 on September 03, 2023 14:40.