Skip to content

Commit

Permalink
Merge pull request #12 from zobay/group_by_dropdow
Browse files Browse the repository at this point in the history
Add support for select_grouped in field
  • Loading branch information
phpfour committed Oct 23, 2023
2 parents bdc50a5 + 6acfc88 commit 43e8010
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Fields/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,32 @@ public function columnDefinition(): array
'type' => 'select',
]);
}

public function selectGrouped(): self
{
$this->type = 'select_grouped';

return $this;
}

public function groupBy(string $groupBy): self
{
$this->props['group_by'] = $groupBy;

return $this;
}

public function groupByAttribute(string $groupByAttribute): self
{
$this->props['group_by_attribute'] = $groupByAttribute;

return $this;
}

public function groupByRelationshipBack(string $relationship): self
{
$this->props['group_by_relationship_back'] = $relationship;

return $this;
}
}

0 comments on commit 43e8010

Please sign in to comment.