diff --git a/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php b/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php index 7547b1b..1557f5b 100644 --- a/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php +++ b/src/NotFound/Layout/Elements/Table/LayoutTableColumn.php @@ -2,6 +2,8 @@ namespace NotFound\Layout\Elements\Table; +use stdClass; + /** * LayoutTableColumn * @@ -12,11 +14,21 @@ class LayoutTableColumn public function __construct( public string $value, public string $type = 'text', - public object $properties = new \stdClass(), + public object $properties = new stdClass() ) { return $this; } + public function setToggleEndPoint( string $url ) : self + { + if( $this->type !== 'checkbox') + { + throw new \Exception('Can only set toggle endpoint on checkbox type'); + } + $this->properties->toggleEndPoint = $url; + return $this; + } + public function makeLinkButton(string $to, $external = false): self { $this->type = 'InputButton';