-
Notifications
You must be signed in to change notification settings - Fork 84
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
Invalid argument supplied for foreach() #1
Comments
@ergonomicus can you paste your relation functions in models on which you are performing queries, table names of models, and query code? |
@fico7489 I can paste only parts of code, it's an internal app... Here are my models
Here is my controller method
Laravel 5.5.latest and PHP 7.1.12 Thanks. |
both models should use EloquentJoinTrait so you need to user EloquentJoinTrait in Work model also, but a better solution would be to create BaseModel model which extends Model, use EloquentJoinTrait in BaseModel and then both models can extend BaseModel, not Model. PS. I will update the docs so this will be more clear... |
@fico7489 Ok, thank you. I will try again... |
I have followed the instructions on how to install this package, but I get "Invalid argument supplied for foreach()" error in validateJoinQuery($relatedModel) method call. Any idea?
The text was updated successfully, but these errors were encountered: