Skip to content
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

Relationship with json column seems not to work when filtering and searching #4

Open
aerrata opened this issue Mar 10, 2022 · 0 comments

Comments

@aerrata
Copy link

aerrata commented Mar 10, 2022

Hi! Thanks for your work. I am trying to use json column with Laravel but I encountered some small issue with the json column relationships.

I have this set of data, notice the name is inside the json datatype column
image

User.php

public function country()
{
    return $this->belongsTo(Country::class);
}

Index.vue

const params = {
  params: {
    dt_params: JSON.stringify(lazyParams.value),
    searchable_columns: JSON.stringify(['name', 'email', 'country.data.name']),
  }
}

Unfortunately, it return this error when I load the datatable

Call to undefined relationship [data] on model [App\\Models\\Country].

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant