public function getPrimaryKeyForForeignModel()
    {
        $model = $this->getForeignModelInstance();

        if ($this->isModel($model)) {
            return $model->getKeyName();
        }

        return $this->getKeyNameFromResource() ?: 'id';
    }
public function getPrimaryKeyForForeignModel()
    {
        $model = $this->getForeignModelInstance();

        if ($this->isModel($model)) {
            return $model->getKeyName();
        }

        return $this->getKeyNameFromResource() ?: 'id';
    }
public function getPrimaryKeyForForeignModel ( ) { $ model = $ this -> getForeignModelInstance ( ) ; if ( $ this -> isModel ( $ model ) ) { return $ model -> getKeyName ( ) ; } return $ this -> getKeyNameFromResource ( ) ? : 'id' ; }
Gets the name of the foreign model's primary key.

@return string
Gets the name of the foreign model s primary key .