@@ 24-37 (lines=14) @@ | ||
21 | * @return $this |
|
22 | * @see https://datatables.net/reference/option/columnDefs |
|
23 | */ |
|
24 | public function columnDefs($value) |
|
25 | { |
|
26 | if (is_callable($value)) { |
|
27 | $value = app()->call($value); |
|
28 | } |
|
29 | ||
30 | if ($value instanceof Arrayable) { |
|
31 | $value = $value->toArray(); |
|
32 | } |
|
33 | ||
34 | $this->attributes['columnDefs'] = $value; |
|
35 | ||
36 | return $this; |
|
37 | } |
|
38 | ||
39 | /** |
|
40 | * Add a columnDef option. |
|
@@ 46-59 (lines=14) @@ | ||
43 | * @return $this |
|
44 | * @see https://datatables.net/reference/option/columnDefs |
|
45 | */ |
|
46 | public function addColumnDef($value) |
|
47 | { |
|
48 | if (is_callable($value)) { |
|
49 | $value = app()->call($value); |
|
50 | } |
|
51 | ||
52 | if ($value instanceof Arrayable) { |
|
53 | $value = $value->toArray(); |
|
54 | } |
|
55 | ||
56 | $this->attributes['columnDefs'][] = $value; |
|
57 | ||
58 | return $this; |
|
59 | } |
|
60 | ||
61 | /** |
|
62 | * Set columns option value. |