Framework: Lazy loading not working unless using camelcase?

Created on 8 Jun 2014  Â·  2Comments  Â·  Source: laravel/framework

Hi,
Hi,
My lazy load not working unless I use camelcase on the model relation function name, is this a convention?

eg:
$service->service_dates => get Null
but when I change the model relation function name to serviceDates
$service->serviceDates => get the data correctly

However if I eager load, Service::with('service_dates')->get() work perfectly

Any advise would be appreciate.

Thank you!

Most helpful comment

Thank you Taylor.. Very happy to get reply from you directly :)) I try to
find this in documentation but couldn't find, could you please point me to
the doc about this convention? I want to understand more

Thank you
On Jun 9, 2014 1:22 AM, "Taylor Otwell" [email protected] wrote:

Use camelCase.

—
Reply to this email directly or view it on GitHub
https://github.com/laravel/framework/issues/4614#issuecomment-45444189.

All 2 comments

Use camelCase.

Thank you Taylor.. Very happy to get reply from you directly :)) I try to
find this in documentation but couldn't find, could you please point me to
the doc about this convention? I want to understand more

Thank you
On Jun 9, 2014 1:22 AM, "Taylor Otwell" [email protected] wrote:

Use camelCase.

—
Reply to this email directly or view it on GitHub
https://github.com/laravel/framework/issues/4614#issuecomment-45444189.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

YannPl picture YannPl  Â·  3Comments

lzp819739483 picture lzp819739483  Â·  3Comments

jackmu95 picture jackmu95  Â·  3Comments

Fuzzyma picture Fuzzyma  Â·  3Comments

gabriellimo picture gabriellimo  Â·  3Comments