Illuminate\Database\Eloquent\Relations\BelongsTo::getForeignKey PHP Метод

getForeignKey() публичный Метод

Get the foreign key of the relationship.
public getForeignKey ( ) : string
Результат string
    public function getForeignKey()
    {
        return $this->foreignKey;
    }

Usage Example

Пример #1
7
 /**
  * @param QueryBuilder $builder
  * @param $data
  *
  * @return void
  */
 public function applyFilterConstraint(QueryBuilder $builder, $data)
 {
     if (empty($data)) {
         return;
     }
     $builder->whereIn($this->relation->getForeignKey(), explode(',', $data));
 }
All Usage Examples Of Illuminate\Database\Eloquent\Relations\BelongsTo::getForeignKey