src/Relations/BelongsToThrough.php
protected function getForeignKeyName(Model $model)
    {
        $table = $model->getTable();

        if (array_key_exists($table, $this->foreignKeyLookup)) {
            return $this->foreignKeyLookup[$table];
        }

        return Str::singular($table).'_id';
    }
protected function getForeignKeyName(Model $model)
    {
        $table = $model->getTable();

        if (array_key_exists($table, $this->foreignKeyLookup)) {
            return $this->foreignKeyLookup[$table];
        }

        return Str::singular($table).'_id';
    }
protected function getForeignKeyName ( Model $ model ) { $ table = $ model -> getTable ( ) ; if ( array_key_exists ( $ table , $ this -> foreignKeyLookup ) ) { return $ this -> foreignKeyLookup [ $ table ] ; } return Str :: singular ( $ table ) . '_id' ; }
Get the foreign key for a model.

@param \Illuminate\Database\Eloquent\Model $model
@return string
Get the foreign key for a model .