Skip to content

Commit df530b4

Browse files
committed
feat: add toggle endpoint
1 parent d5f9158 commit df530b4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/NotFound/Layout/Elements/Table/LayoutTableColumn.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace NotFound\Layout\Elements\Table;
44

5+
use stdClass;
6+
57
/**
68
* LayoutTableColumn
79
*
@@ -12,11 +14,21 @@ class LayoutTableColumn
1214
public function __construct(
1315
public string $value,
1416
public string $type = 'text',
15-
public object $properties = new \stdClass(),
17+
public object $properties = new stdClass()
1618
) {
1719
return $this;
1820
}
1921

22+
public function setToggleEndPoint( string $url ) : self
23+
{
24+
if( $this->type !== 'checkbox')
25+
{
26+
throw new \Exception('Can only set toggle endpoint on checkbox type');
27+
}
28+
$this->properties->toggleEndPoint = $url;
29+
return $this;
30+
}
31+
2032
public function makeLinkButton(string $to, $external = false): self
2133
{
2234
$this->type = 'InputButton';

0 commit comments

Comments
 (0)