Skip to content

HasMany 'column' value is not setting the foreign key #67

Description

@creatoro

The 'column' filed type can be used with HasMany fields to set the foreign key according to the readme. But if I get it right this isn't the case, as it uses 'model_id' as foreign key even when this value is set.

It seems this line is where a possible fix can be applied (I solved it by a simple if statement checking if the 'column' value is available and using it instead of $this->fk() if so):

http://github.com/shadowhand/sprig/blob/master/classes/sprig.php#L355

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions