Skip to content

Commit 4a1aaa0

Browse files
committed
Update getTdAttributes to take 4th missing argument
1 parent 878eb8e commit 4a1aaa0

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
1111
### Changed
1212

1313
- Update filter docs - https://github.com/rappasoft/laravel-livewire-tables/pull/691
14+
- Update getTdAttributes to take 4th missing argument
1415

1516
## [2.0.0] - 2022-03-30
1617

src/Traits/Helpers/ComponentHelpers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ public function getTrAttributes(Model $row, int $index): array
127127
*
128128
* @return bool[]
129129
*/
130-
public function getTdAttributes(Column $column, Model $row, int $index): array
130+
public function getTdAttributes(Column $column, Model $row, int $colIndex, int $rowIndex): array
131131
{
132-
return $this->tdAttributesCallback ? call_user_func($this->tdAttributesCallback, $column, $row, $index) : ['default' => true];
132+
return $this->tdAttributesCallback ? call_user_func($this->tdAttributesCallback, $column, $row, $colIndex, $rowIndex) : ['default' => true];
133133
}
134134

135135
/**

tests/Traits/Configuration/ComponentConfigurationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ public function can_set_td_attributes(): void
100100
return ['default' => true, 'here' => 'there'];
101101
});
102102

103-
$this->assertSame($this->basicTable->getTdAttributes($this->basicTable->columns()[1], Pet::find(1), 0), ['default' => true, 'here' => 'there']);
104-
$this->assertSame($this->basicTable->getTdAttributes($this->basicTable->columns()[0], Pet::find(2), 1), ['default' => false, 'this' => 'that']);
103+
$this->assertSame($this->basicTable->getTdAttributes($this->basicTable->columns()[1], Pet::find(1), 0, 1), ['default' => true, 'here' => 'there']);
104+
$this->assertSame($this->basicTable->getTdAttributes($this->basicTable->columns()[0], Pet::find(2), 1, 1), ['default' => false, 'this' => 'that']);
105105
}
106106

107107
/** @test */

0 commit comments

Comments
 (0)