Refactor table components to use GenericTableSettings and remove deprecated classes

This commit is contained in:
David
2025-04-25 01:19:30 -04:00
parent 7466083798
commit 9f12bc28d0
17 changed files with 177 additions and 203 deletions

View File

@@ -3,30 +3,19 @@
namespace App\Tables;
use App\Models\Product;
use App\Tables\Traits\WithExportableProductColumns;
use Illuminate\Database\Eloquent\Model;
use Mmt\GenericTable\Interfaces\IActionColumn;
use Mmt\GenericTable\Interfaces\IEvent;
use Mmt\GenericTable\Interfaces\IGenericTable;
use Mmt\GenericTable\Support\EventArgs;
use Mmt\GenericTable\Interfaces\IRowData;
class TableWithActionColumn implements IGenericTable, IActionColumn, IEvent
class TableWithActionColumn implements IGenericTable, IActionColumn
{
use WithExportableProductColumns;
public Model|string $model = Product::class;
public int $actionColumnIndex = 0;
public function actionView(Model $item): \Illuminate\View\View
public function actionView(IRowData $row): \Illuminate\View\View
{
return view("tables_action_views.edit_delete_details", ['productId' => $item->id]);
}
public function dispatchCallback(EventArgs $arguments): void
{
return view("tables_action_views.edit_delete_details", ['productId' => $row->get('name')]);
}
}