Refactor table components to use GenericTableSettings and remove deprecated classes
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace App\Tables;
|
||||
|
||||
use App\Models\Product;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Mmt\GenericTable\Components\Column;
|
||||
use Mmt\GenericTable\Components\ColumnCollection;
|
||||
use Mmt\GenericTable\Interfaces\IBulkAction;
|
||||
@@ -12,20 +11,17 @@ use Mmt\GenericTable\Support\BulkAction;
|
||||
use Mmt\GenericTable\Support\BulkActionCollection;
|
||||
use Mmt\GenericTable\Support\BulkActionGroup;
|
||||
use Mmt\GenericTable\Support\BulkActionSettings;
|
||||
use Mmt\GenericTable\Support\GenericTableSettings;
|
||||
|
||||
class TableWithBulkActions implements IGenericTable, IBulkAction
|
||||
{
|
||||
public Model|string $model;
|
||||
|
||||
public ColumnCollection $columns;
|
||||
public GenericTableSettings $tableSettings;
|
||||
|
||||
public BulkActionCollection $bulkActionCollection;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->model = new Product();
|
||||
|
||||
$this->columns = ColumnCollection::make(
|
||||
$columns = ColumnCollection::make(
|
||||
new Column('Id'),
|
||||
new Column('Description'),
|
||||
new Column('Price'),
|
||||
@@ -48,6 +44,8 @@ class TableWithBulkActions implements IGenericTable, IBulkAction
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$this->tableSettings = new GenericTableSettings(Product::class, $columns);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user