Venky
Table reload in custom livewire tab by updating in another tab table record.
I have a resource page with Tab implementation. First tab for draft items loaded through livewire page. The second tab is with published items. I wants to refresh the second table when ever I am publishing a record in First tab. Below is the main page
12 replies
Converting collection to Builder is not giving data.
I have two different table called 'invoices' and 'receipts'. So, I just want to show the both records as a ledger sheet with closing balance amount as last column in the table. I am trying to do this using below. But, it is showing no records found in the table. But, we can see the records in while doing print (dd). Am I doing woring apprroach here. Is there any better way to do this.
protected function getTableQuery(): Builder
{
$invoices = Invoice::select(
DB::raw("'invoice' as type"),
'invoices.created_at as date',
'invoices.invoice_amount as amount'
)
->where('invoice_to', Session::get('current_franchisee'))
->orderBy('date');
$receipts = Receipt::select(
DB::raw("'receipt' as type"),
'receipts.created_at as date',
'receipts.amount as amount'
)
->where('received_from', Session::get('current_franchisee'))
->orderBy('date');
$transactions = $invoices->union($receipts)->get();
$closing_balance = 0;
foreach ($transactions as $k => $transaction) {
$closing_balance = ($transaction->type === 'invoice' ? $transaction->amount + $closing_balance : $closing_balance - $transaction->amount);
$transactions[$k]->closing_balance = $closing_balance;
}
return $transactions->toQuery();
}
protected function getTableColumns(): array
{
return [
TextColumn::make('type'),
TextColumn::make('amount'),
TextColumn::make('closing_balance'),
];
}
7 replies
filament-sidebar-item-active class is not there in custom pages
Hi all, I am facing an issue where we unable to see the selected menu on screen if we have many. so I installed https://github.com/ibrahimBougaoua/filament-menu-scroll-fix which resolved only for resources not for the custom pages. I don't know What I missed. I found that the custom menus are not having 'filament-sidebar-item-active' class after selection.
Can any one guide me to resolve this?
4 replies
SelectColumn: disable auto update and using selected value in bulk action
I want to use selected value from 'SelectColumn' field and to be used in bulk action without updating the field. Is it possible?
I have this scenario in many pages. It will be helpful if some one guide me . Thanks in advance.
7 replies