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 method must return an object of type #28

Open
SanjayHarkaj opened this issue Jan 5, 2017 · 2 comments
Open

Relationship method must return an object of type #28

SanjayHarkaj opened this issue Jan 5, 2017 · 2 comments

Comments

@SanjayHarkaj
Copy link

SanjayHarkaj commented Jan 5, 2017

I am getting an error exception while using setValueCalculator
when i use setValueFormator and return value it works fine

Code chunk

user_id

Screen Output (it worked fine)

works_fine

but when i use setValueFormator and return $value->user it gives error

user_name

Screen

user_name_exception

PLease help me out
Am i missing anything

@Nayjest
Copy link
Member

Nayjest commented Jan 9, 2017

Hi!
Looks like something wrong with laravel model relationships, see YourModelClass::user() method.
Try to execute your query & do:

foreach($models as $model) {
   echo $model->user->name;
}

And probably you will get same error.

@bretto36
Copy link
Contributor

bretto36 commented Feb 3, 2017

Can you put in your DataProvider code so we can look at that

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

3 participants