Files
generic_table_examples/app/Tables/TableWithActionColumn.php
2025-03-12 00:41:31 -04:00

32 lines
790 B
PHP

<?php
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;
class TableWithActionColumn implements IGenericTable, IActionColumn, IEvent
{
use WithExportableProductColumns;
public Model|string $model = Product::class;
public int $actionColumnIndex = -1;
public function actionView(Model $item): \Illuminate\View\View
{
return view("tables_action_views.edit_delete_details", ['productId' => $item->id]);
}
public function dispatchCallback(EventArgs $arguments): void
{
}
}