Are you developing on mac or windows? Both are case insensitve
Aug 17, 2022
4
Level 8
Laravel "knows" to fix wrongly capitalized relationship name?
I accidentally named my relationship at first with PascalCase:
public function MyRelationship()
{
// return ...
}
and also used it in some parts of the code: Auth::user()->MyRelationship->some_column;
But then I renamed the relationship to camelCase:
public function myRelationship()
{
// return ...
}
but didn't change the code invoking it, and it still worked. I tried to use both myRelationship and MyRelationship and both work
Level 102
1 like
Please or to participate in this conversation.