File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 88use Yajra \DataTables \Html \Options \Plugins \SearchPanes ;
99
1010/**
11- * @property string $data
11+ * @property array| string $data
1212 * @property string $name
1313 * @property string $title
1414 * @property string $titleAttr
@@ -311,11 +311,12 @@ public function width(int|string $value): static
311311 /**
312312 * Set column data option value.
313313 *
314- * @param string $value
314+ * @param array| string $value
315315 * @return $this
316316 * @see https://datatables.net/reference/option/columns.data
317+ * @see https://datatables.net/manual/data/orthogonal-data
317318 */
318- public function data (string $ value ): static
319+ public function data (array | string $ value ): static
319320 {
320321 $ this ->attributes ['data ' ] = $ value ;
321322
Original file line number Diff line number Diff line change @@ -155,4 +155,18 @@ public function it_can_render_scripts()
155155 $ column ->renderRaw ('test ' );
156156 $ this ->assertEquals ('test ' , $ column ->render );
157157 }
158+
159+ /** @test */
160+ public function it_allows_orthogonal_data ()
161+ {
162+ $ expected = [
163+ '_ ' => 'test ' ,
164+ 'sort ' => 'test ' ,
165+ 'filter ' => 'test ' ,
166+ 'type ' => 'test ' ,
167+ ];
168+ $ column = Column::make ('name ' )->data ($ expected );
169+
170+ $ this ->assertEquals ($ expected , $ column ->data );
171+ }
158172}
You can’t perform that action at this time.
0 commit comments