Support the ongoing development of Laravel.io →
Input Database Eloquent
Last updated 7 months ago.
0
Solution

Oh... I found this comment:

// If the "attribute" exists as a method on the model, we will just assume
// it is a relationship and will load and return results from the query
// and hydrate the relationship's value on the "relationships" array.

Strange behavior. It seems you cant have attribute and method with same name.

Last updated 6 years ago.
0

Sign in to participate in this thread!

LaraJobs

Your banner here too?

kticka kticka Joined 7 Aug 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.