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

[5.4] Null return in a model relation with a id=0 key in DB table #17669

Closed
neoteknic opened this issue Jan 30, 2017 · 2 comments
Closed

[5.4] Null return in a model relation with a id=0 key in DB table #17669

neoteknic opened this issue Jan 30, 2017 · 2 comments

Comments

@neoteknic
Copy link
Contributor

  • Laravel Version: 5.4.6
  • PHP Version: 7.1.1
  • Database Driver & Version: MariaDB 10.1.20

Description:

Eloquent relation return null instead of model when the id key in the database table is 0 (for non auto-increment table), it works fine in 5.2/5.3.

Steps To Reproduce:

Use a relation like belongTo in a model, submodel have key like id 0,1,2 if key = 0 the relation return null instead of returning the submodel .

@ntzm
Copy link
Contributor

ntzm commented Jan 30, 2017

#17668

@neoteknic
Copy link
Contributor Author

Fixed in #17668

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

2 participants