umardi_
Add Action Button on Topbar
I tried to add cart button next to the notification icon on topbar. But it didn't work. No modal opens when I clicked it.
Here is the code in AppPanelProvider.php
and here is the add-cart-button.blade.php
Can someone please show me what's wrong and point me in the right direction. Thank you.
4 replies
Send parameters with an event emission in table filters
How can we send parameters with an event emission in table filters, in this case SelectFilter. Is there any available method?
Here is the filter:
Tables\Filters\SelectFilter::make('conditions')
->options(config('options.conditions'))
I want to pass the value to this function:
public function updateTableFilters(string $filter, $value): void
{
$this->tableFilters[$filter]['value'] = $value;
}
the listeners:
protected $listeners = ['filterUpdate' => 'updateTableFilters'];
2 replies
Dynamic getTableQuery on Toggle Filter
Hello everyone. For many cases, I want to dynamically return different query from getTableQuery based on toggle filter. Initially, we want the X query with some records (toggle OFF). But when we toggle ON a filter, execute Y query to return new records. For example:
Toggle filter example:
protected function getTableFilters(): array
{
return [
Tables\Filters\Filter::make('notifikasi_pemeliharaan')
->query(fn (Builder $query): Builder => $query->where('notifikasi_pemeliharaan', false))
->columnSpan('full')
->toggle(),
];
}
Query before (When Toggle filter OFF)
protected function getTableQuery(): Builder
{
return Peralatan::query()
->where('aktif_tidak', true)
->where('pelihara_tidak', true)
});
}
Query expected, after toggle ON
protected function getTableQuery(): Builder
{
return Peralatan::query()
->where('aktif_tidak', true)
->where('pelihara_tidak', true)
->where('notifikasi_pemeliharaan', true) // Now it pull new records that not exists in table before
});
}
How to make it possible? Or is there any better approach? Thank you all.5 replies
Making Table Header and First Table Column Sticky
Hello everyone. I think it will be nice if table header and first column sticky. It will be useful to view the data if we have a lot of columns. Kind like spreadsheet. Should I create custom css, or I miss something in documentation how to do it? Thank you.
2 replies