Refactor table components to use GenericTableSettings and remove deprecated classes
This commit is contained in:
@@ -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')]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user