Ye Thi Ha Htwe
Table action modal not showing up for some records
Hi everyone! As the title says, I have this table in a Resource's custom page.
The is the
public function table(Table $table): Table
{
return $table
->query($this->getTableQuery())
->columns([
TableComponents::itemNameColumn()->searchable(),
// other columns
])
->actions([
TableActions::batchOutAction(),
Action::make('test')->action(fn(Model $record) => dd($record)),
]);
}
public function getTableQuery()
{
return TableQueries::outgoingQuery();
}
public function table(Table $table): Table
{
return $table
->query($this->getTableQuery())
->columns([
TableComponents::itemNameColumn()->searchable(),
// other columns
])
->actions([
TableActions::batchOutAction(),
Action::make('test')->action(fn(Model $record) => dd($record)),
]);
}
public function getTableQuery()
{
return TableQueries::outgoingQuery();
}
TableQueries::outgoingQuery()
.
public static function outgoingQuery()
{
return Transaction::query()
->selectRaw('min(id) as id, item_id, category_id, subcategory_id, exp_date, batch, donor_id, project_id, SUM(amount) as amount, warehouse_id')
->groupBy('item_id', 'category_id', 'subcategory_id', 'exp_date', 'batch', 'donor_id', 'project_id', 'warehouse_id')
->havingRaw('SUM(amount) > 0');
}
public static function outgoingQuery()
{
return Transaction::query()
->selectRaw('min(id) as id, item_id, category_id, subcategory_id, exp_date, batch, donor_id, project_id, SUM(amount) as amount, warehouse_id')
->groupBy('item_id', 'category_id', 'subcategory_id', 'exp_date', 'batch', 'donor_id', 'project_id', 'warehouse_id')
->havingRaw('SUM(amount) > 0');
}
2 replies