@@ -167,7 +167,7 @@ public static function canCreate($source)
167
167
* Factory method, create and return an instance for the DataTable engine.
168
168
*
169
169
* @param mixed $source
170
- * @return static
170
+ * @return $this
171
171
*/
172
172
public static function create ($ source )
173
173
{
@@ -178,11 +178,11 @@ public static function create($source)
178
178
/**
179
179
* @param string|array $columns
180
180
* @param string|\Yajra\DataTables\Contracts\Formatter $formatter
181
- * @return static
181
+ * @return $this
182
182
*
183
183
* @throws \Yajra\DataTables\Exceptions\Exception
184
184
*/
185
- public function formatColumn ($ columns , $ formatter ): self
185
+ public function formatColumn ($ columns , $ formatter ): static
186
186
{
187
187
if (is_string ($ formatter ) && class_exists ($ formatter )) {
188
188
$ formatter = app ($ formatter );
@@ -205,9 +205,9 @@ public function formatColumn($columns, $formatter): self
205
205
* @param string $name
206
206
* @param string|callable|Formatter $content
207
207
* @param bool|int $order
208
- * @return static
208
+ * @return $this
209
209
*/
210
- public function addColumn ($ name , $ content , $ order = false ): self
210
+ public function addColumn ($ name , $ content , $ order = false ): static
211
211
{
212
212
$ this ->extraColumns [] = $ name ;
213
213
@@ -219,9 +219,9 @@ public function addColumn($name, $content, $order = false): self
219
219
/**
220
220
* Add DT row index column on response.
221
221
*
222
- * @return static
222
+ * @return $this
223
223
*/
224
- public function addIndexColumn (): self
224
+ public function addIndexColumn (): static
225
225
{
226
226
$ this ->columnDef ['index ' ] = true ;
227
227
@@ -233,9 +233,9 @@ public function addIndexColumn(): self
233
233
*
234
234
* @param string $name
235
235
* @param string|callable $content
236
- * @return static
236
+ * @return $this
237
237
*/
238
- public function editColumn ($ name , $ content ): self
238
+ public function editColumn ($ name , $ content ): static
239
239
{
240
240
$ this ->columnDef ['edit ' ][] = ['name ' => $ name , 'content ' => $ content ];
241
241
@@ -245,9 +245,9 @@ public function editColumn($name, $content): self
245
245
/**
246
246
* Remove column from collection.
247
247
*
248
- * @return static
248
+ * @return $this
249
249
*/
250
- public function removeColumn (): self
250
+ public function removeColumn (): static
251
251
{
252
252
$ names = func_get_args ();
253
253
$ this ->columnDef ['excess ' ] = array_merge ($ this ->getColumnsDefinition ()['excess ' ], $ names );
@@ -272,9 +272,9 @@ protected function getColumnsDefinition(): array
272
272
* Get only selected columns in response.
273
273
*
274
274
* @param array $columns
275
- * @return static
275
+ * @return $this
276
276
*/
277
- public function only (array $ columns = []): self
277
+ public function only (array $ columns = []): static
278
278
{
279
279
$ this ->columnDef ['only ' ] = $ columns ;
280
280
@@ -285,9 +285,9 @@ public function only(array $columns = []): self
285
285
* Declare columns to escape values.
286
286
*
287
287
* @param string|array $columns
288
- * @return static
288
+ * @return $this
289
289
*/
290
- public function escapeColumns ($ columns = '* ' ): self
290
+ public function escapeColumns ($ columns = '* ' ): static
291
291
{
292
292
$ this ->columnDef ['escape ' ] = $ columns ;
293
293
@@ -298,9 +298,9 @@ public function escapeColumns($columns = '*'): self
298
298
* Add a makeHidden() to the row object.
299
299
*
300
300
* @param array $attributes
301
- * @return static
301
+ * @return $this
302
302
*/
303
- public function makeHidden (array $ attributes = []): self
303
+ public function makeHidden (array $ attributes = []): static
304
304
{
305
305
$ hidden = (array ) Arr::get ($ this ->columnDef , 'hidden ' , []);
306
306
$ this ->columnDef ['hidden ' ] = array_merge_recursive ($ hidden , $ attributes );
@@ -312,9 +312,9 @@ public function makeHidden(array $attributes = []): self
312
312
* Add a makeVisible() to the row object.
313
313
*
314
314
* @param array $attributes
315
- * @return static
315
+ * @return $this
316
316
*/
317
- public function makeVisible (array $ attributes = []): self
317
+ public function makeVisible (array $ attributes = []): static
318
318
{
319
319
$ visible = (array ) Arr::get ($ this ->columnDef , 'visible ' , []);
320
320
$ this ->columnDef ['visible ' ] = array_merge_recursive ($ visible , $ attributes );
@@ -328,9 +328,9 @@ public function makeVisible(array $attributes = []): self
328
328
*
329
329
* @param array $columns
330
330
* @param bool $merge
331
- * @return static
331
+ * @return $this
332
332
*/
333
- public function rawColumns (array $ columns , $ merge = false ): self
333
+ public function rawColumns (array $ columns , $ merge = false ): static
334
334
{
335
335
if ($ merge ) {
336
336
/** @var array[] $config */
@@ -349,9 +349,9 @@ public function rawColumns(array $columns, $merge = false): self
349
349
* result: <tr class="output_from_your_template">.
350
350
*
351
351
* @param string|callable $content
352
- * @return static
352
+ * @return $this
353
353
*/
354
- public function setRowClass ($ content ): self
354
+ public function setRowClass ($ content ): static
355
355
{
356
356
$ this ->templates ['DT_RowClass ' ] = $ content ;
357
357
@@ -363,9 +363,9 @@ public function setRowClass($content): self
363
363
* result: <tr id="output_from_your_template">.
364
364
*
365
365
* @param string|callable $content
366
- * @return static
366
+ * @return $this
367
367
*/
368
- public function setRowId ($ content ): self
368
+ public function setRowId ($ content ): static
369
369
{
370
370
$ this ->templates ['DT_RowId ' ] = $ content ;
371
371
@@ -376,9 +376,9 @@ public function setRowId($content): self
376
376
* Set DT_RowData templates.
377
377
*
378
378
* @param array $data
379
- * @return static
379
+ * @return $this
380
380
*/
381
- public function setRowData (array $ data ): self
381
+ public function setRowData (array $ data ): static
382
382
{
383
383
$ this ->templates ['DT_RowData ' ] = $ data ;
384
384
@@ -390,9 +390,9 @@ public function setRowData(array $data): self
390
390
*
391
391
* @param string $key
392
392
* @param string|callable $value
393
- * @return static
393
+ * @return $this
394
394
*/
395
- public function addRowData ($ key , $ value ): self
395
+ public function addRowData ($ key , $ value ): static
396
396
{
397
397
$ this ->templates ['DT_RowData ' ][$ key ] = $ value ;
398
398
@@ -404,9 +404,9 @@ public function addRowData($key, $value): self
404
404
* result: <tr attr1="attr1" attr2="attr2">.
405
405
*
406
406
* @param array $data
407
- * @return static
407
+ * @return $this
408
408
*/
409
- public function setRowAttr (array $ data ): self
409
+ public function setRowAttr (array $ data ): static
410
410
{
411
411
$ this ->templates ['DT_RowAttr ' ] = $ data ;
412
412
@@ -418,9 +418,9 @@ public function setRowAttr(array $data): self
418
418
*
419
419
* @param string $key
420
420
* @param string|callable $value
421
- * @return static
421
+ * @return $this
422
422
*/
423
- public function addRowAttr ($ key , $ value ): self
423
+ public function addRowAttr ($ key , $ value ): static
424
424
{
425
425
$ this ->templates ['DT_RowAttr ' ][$ key ] = $ value ;
426
426
@@ -432,9 +432,9 @@ public function addRowAttr($key, $value): self
432
432
*
433
433
* @param mixed $key
434
434
* @param mixed $value
435
- * @return static
435
+ * @return $this
436
436
*/
437
- public function with ($ key , $ value = '' ): self
437
+ public function with ($ key , $ value = '' ): static
438
438
{
439
439
if (is_array ($ key )) {
440
440
$ this ->appends = $ key ;
@@ -452,9 +452,9 @@ public function with($key, $value = ''): self
452
452
*
453
453
* @param string $key
454
454
* @param callable $value
455
- * @return static
455
+ * @return $this
456
456
*/
457
- public function withQuery ($ key , callable $ value ): self
457
+ public function withQuery ($ key , callable $ value ): static
458
458
{
459
459
$ this ->appends [$ key ] = $ value ;
460
460
@@ -465,9 +465,9 @@ public function withQuery($key, callable $value): self
465
465
* Override default ordering method with a closure callback.
466
466
*
467
467
* @param callable $closure
468
- * @return static
468
+ * @return $this
469
469
*/
470
- public function order (callable $ closure ): self
470
+ public function order (callable $ closure ): static
471
471
{
472
472
$ this ->orderCallback = $ closure ;
473
473
@@ -478,9 +478,9 @@ public function order(callable $closure): self
478
478
* Update list of columns that is not allowed for search/sort.
479
479
*
480
480
* @param array $blacklist
481
- * @return static
481
+ * @return $this
482
482
*/
483
- public function blacklist (array $ blacklist ): self
483
+ public function blacklist (array $ blacklist ): static
484
484
{
485
485
$ this ->columnDef ['blacklist ' ] = $ blacklist ;
486
486
@@ -491,9 +491,9 @@ public function blacklist(array $blacklist): self
491
491
* Update list of columns that is allowed for search/sort.
492
492
*
493
493
* @param string|array $whitelist
494
- * @return static
494
+ * @return $this
495
495
*/
496
- public function whitelist ($ whitelist = '* ' ): self
496
+ public function whitelist ($ whitelist = '* ' ): static
497
497
{
498
498
$ this ->columnDef ['whitelist ' ] = $ whitelist ;
499
499
@@ -504,9 +504,9 @@ public function whitelist($whitelist = '*'): self
504
504
* Set smart search config at runtime.
505
505
*
506
506
* @param bool $state
507
- * @return static
507
+ * @return $this
508
508
*/
509
- public function smart ($ state = true ): self
509
+ public function smart ($ state = true ): static
510
510
{
511
511
$ this ->config ->set ('datatables.search.smart ' , $ state );
512
512
@@ -517,9 +517,9 @@ public function smart($state = true): self
517
517
* Set starts_with search config at runtime.
518
518
*
519
519
* @param bool $state
520
- * @return static
520
+ * @return $this
521
521
*/
522
- public function startsWithSearch ($ state = true ): self
522
+ public function startsWithSearch ($ state = true ): static
523
523
{
524
524
$ this ->config ->set ('datatables.search.starts_with ' , $ state );
525
525
@@ -530,9 +530,9 @@ public function startsWithSearch($state = true): self
530
530
* Set multi_term search config at runtime.
531
531
*
532
532
* @param bool $multiTerm
533
- * @return static
533
+ * @return $this
534
534
*/
535
- public function setMultiTerm ($ multiTerm = true ): self
535
+ public function setMultiTerm ($ multiTerm = true ): static
536
536
{
537
537
$ this ->config ->set ('datatables.search.multi_term ' , $ multiTerm );
538
538
@@ -543,9 +543,9 @@ public function setMultiTerm($multiTerm = true): self
543
543
* Set total records manually.
544
544
*
545
545
* @param int $total
546
- * @return static
546
+ * @return $this
547
547
*/
548
- public function setTotalRecords ($ total ): self
548
+ public function setTotalRecords ($ total ): static
549
549
{
550
550
$ this ->totalRecords = $ total ;
551
551
@@ -556,9 +556,9 @@ public function setTotalRecords($total): self
556
556
* Set filtered records manually.
557
557
*
558
558
* @param int $total
559
- * @return static
559
+ * @return $this
560
560
*/
561
- public function setFilteredRecords ($ total ): self
561
+ public function setFilteredRecords ($ total ): static
562
562
{
563
563
$ this ->filteredRecords = $ total ;
564
564
@@ -568,9 +568,9 @@ public function setFilteredRecords($total): self
568
568
/**
569
569
* Skip pagination as needed.
570
570
*
571
- * @return static
571
+ * @return $this
572
572
*/
573
- public function skipPaging (): self
573
+ public function skipPaging (): static
574
574
{
575
575
$ this ->skipPaging = true ;
576
576
@@ -581,9 +581,9 @@ public function skipPaging(): self
581
581
* Push a new column name to blacklist.
582
582
*
583
583
* @param string $column
584
- * @return static
584
+ * @return $this
585
585
*/
586
- public function pushToBlacklist ($ column ): self
586
+ public function pushToBlacklist ($ column ): static
587
587
{
588
588
if (! $ this ->isBlacklisted ($ column )) {
589
589
$ this ->columnDef ['blacklist ' ][] = $ column ;
@@ -647,9 +647,9 @@ abstract protected function defaultOrdering(): void;
647
647
*
648
648
* @param callable $callback
649
649
* @param bool $globalSearch
650
- * @return static
650
+ * @return $this
651
651
*/
652
- public function filter (callable $ callback , $ globalSearch = false ): self
652
+ public function filter (callable $ callback , $ globalSearch = false ): static
653
653
{
654
654
$ this ->autoFilter = $ globalSearch ;
655
655
$ this ->isFilterApplied = true ;
@@ -679,9 +679,9 @@ public function toJson($options = 0)
679
679
* @param string $column
680
680
* @param mixed $options
681
681
* @param callable|null $builder
682
- * @return static
682
+ * @return $this
683
683
*/
684
- public function searchPane ($ column , $ options , callable $ builder = null ): self
684
+ public function searchPane ($ column , $ options , callable $ builder = null ): static
685
685
{
686
686
$ options = value ($ options );
687
687
@@ -942,9 +942,9 @@ public function getLogger()
942
942
* Set monolog/logger instance.
943
943
*
944
944
* @param \Psr\Log\LoggerInterface $logger
945
- * @return static
945
+ * @return $this
946
946
*/
947
- public function setLogger (LoggerInterface $ logger ): self
947
+ public function setLogger (LoggerInterface $ logger ): static
948
948
{
949
949
$ this ->logger = $ logger ;
950
950
0 commit comments