diff --git a/src/Views/Columns/BooleanColumn.php b/src/Views/Columns/BooleanColumn.php index 38dcf7216..30716b0e3 100644 --- a/src/Views/Columns/BooleanColumn.php +++ b/src/Views/Columns/BooleanColumn.php @@ -45,6 +45,7 @@ public function getContents(Model $row): null|string|\Illuminate\Support\HtmlStr ->withIsBootstrap($this->isBootstrap()) ->withSuccessValue($this->getSuccessValue()) ->withType($this->getType()) + ->withValue($value) ->withStatus($this->hasCallback() ? call_user_func($this->getCallback(), $value, $row) : (bool) $value === true); } } diff --git a/tests/Views/Columns/BooleanColumnTest.php b/tests/Views/Columns/BooleanColumnTest.php index 6280af52c..0fdc61196 100644 --- a/tests/Views/Columns/BooleanColumnTest.php +++ b/tests/Views/Columns/BooleanColumnTest.php @@ -104,6 +104,20 @@ public function test_can_set_toggleable_with_confirm_message(): void $this->assertTrue($column->hasConfirmMessage()); $this->assertSame('Are you sure?', $column->getConfirmMessage()); + } + public function test_can_get_value(): void + { + $column = BooleanColumn::make('Name')->getContents(Pet::find(1)); + $this->assertSame($column['value'], 'Cartman'); } + + public function test_can_get_is_tailwind(): void + { + $column = BooleanColumn::make('Name')->getContents(Pet::find(1)); + $this->assertSame($column['isTailwind'], true); + $this->assertSame($column['isBootstrap'], false); + + } + }