-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to Acces Relation #6
Comments
i get the value of floor level by defining custom column
|
You're right @zendzo Nested relationships aren't supported yet. You have used the custom column the right way but you should also tell the query to eager load data to prevent n+1 issue. /**
* Specify additional conditions for the query, if any.
*
* @param \Illuminate\Database\Eloquent\Builder
* @param \Illuminate\Database\Eloquent\Builder
*/
public static function laratablesQueryConditions($query)
{
return $query->with([ 'room.floor.level' ]);
} |
As this isn't a common use case, I would prefer not to add support for now. Have already added the note in the readme. |
i have 3 relations
user ->hasOne->room
room->belongsTo->floor
floor->hasMany->room
The text was updated successfully, but these errors were encountered: