src/Eloquent/Concerns/IncludesModels.php
protected function modelRelationForField($field)
    {
        return $this->camelCaseRelations ? Str::camelize($field) : Str::underscore($field);
    }
protected function modelRelationForField($field)
    {
        return $this->camelCaseRelations ? Str::camelize($field) : Str::underscore($field);
    }
protected function modelRelationForField ( $ field ) { return $ this -> camelCaseRelations ? Str :: camelize ( $ field ) : Str :: underscore ( $ field ) ; }
Convert a JSON API field name to an Eloquent model relation name.

According to the PSR1 spec, method names on classes MUST be camel case.
However, there seem to be some Laravel developers who snake case
relationship methods on their models, so that the method name matches
the snake case format of attributes (column values).

The `$camelCaseRelations` property controls the behaviour of this
conversion:

- If `true`, a field name of `user-history` or `user_history` will
expect the Eloquent model relation method to be `userHistory`.
- If `false`, a field name of `user-history` or `user_history` will
expect the Eloquent model relation method to be `user_history`. I.e.
if PSR1 is not being followed, the best guess is that method names
are snake case.

If the developer has different conversion logic, they should overload
this method and implement it themselves.

@param string $field
the JSON API field name.
@return string
the expected relation name on the Eloquent model.
Convert a JSON API field name to an Eloquent model relation name .