The documentation says:
Eloquent determines the foreign key of the relationship based on the model name.
but in the HasRelationship class in the belongsTo method, I can see this comment
If no foreign key was supplied, we can use a backtrace to guess the proper foreign key name by using the name of the relationship function, which when combined with an "_id" should conventionally match the columns.
So.. the documentation is wrong?
I've tested it and is true..so how it works exactly? (I already know how to set it manually)
Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.