refactor: move prependColumn logic into separate trait
This commit is contained in:
parent
77927608b5
commit
0c0f2f2b92
@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Traits\Datatable;
|
||||
|
||||
use Rappasoft\LaravelLivewireTables\Views\Columns\IncrementColumn;
|
||||
|
||||
trait WithConfiguration
|
||||
{
|
||||
public function configure(): void
|
||||
@ -60,11 +58,4 @@ public function configure(): void
|
||||
->setDefaultPerPage(25)
|
||||
->setPerPageAccepted([25, 50, 100, 1000]);
|
||||
}
|
||||
|
||||
public function prependColumns(): array
|
||||
{
|
||||
return [
|
||||
IncrementColumn::make('#'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
15
app/Traits/Datatable/WithPrependColumn.php
Normal file
15
app/Traits/Datatable/WithPrependColumn.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Traits\Datatable;
|
||||
|
||||
use Rappasoft\LaravelLivewireTables\Views\Columns\IncrementColumn;
|
||||
|
||||
trait WithPrependColumn
|
||||
{
|
||||
public function prependColumns(): array
|
||||
{
|
||||
return [
|
||||
IncrementColumn::make('#'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user