umardi_
umardi_
FFilament
Created by umardi_ on 10/1/2024 in #❓┊help
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
->renderHook(
PanelsRenderHook::GLOBAL_SEARCH_AFTER,
function () {
$action = Action::make('cartAction')
->label('')
->icon('heroicon-o-shopping-cart')
->iconSize('lg')
->color('gray')
->iconButton()
->slideOver()
->form([
TextInput::make('subject'),
])
->action(function (array $data) {
// Handle the action logic here
dd($data);

});

return view('components.add-cart-button', compact('action'));
}
)
->renderHook(
PanelsRenderHook::GLOBAL_SEARCH_AFTER,
function () {
$action = Action::make('cartAction')
->label('')
->icon('heroicon-o-shopping-cart')
->iconSize('lg')
->color('gray')
->iconButton()
->slideOver()
->form([
TextInput::make('subject'),
])
->action(function (array $data) {
// Handle the action logic here
dd($data);

});

return view('components.add-cart-button', compact('action'));
}
)
and here is the add-cart-button.blade.php
<div class="relative">
{{ $action }}
<div class="absolute start-full top-1 z-[1] w-max -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2" style="transform: translate(-50%, -50%) translate(5px, -5px);">
<x-filament::badge size="xs" color="warning">3</x-filament::badge>
</div>
</div>
<div class="relative">
{{ $action }}
<div class="absolute start-full top-1 z-[1] w-max -translate-x-1/2 -translate-y-1/2 rtl:translate-x-1/2" style="transform: translate(-50%, -50%) translate(5px, -5px);">
<x-filament::badge size="xs" color="warning">3</x-filament::badge>
</div>
</div>
Can someone please show me what's wrong and point me in the right direction. Thank you.
4 replies
FFilament
Created by umardi_ on 11/30/2023 in #❓┊help
Whitespace-pre-wrap Create Blank Spaces Around Text On Infolist TextEntry Component
No description
2 replies
FFilament
Created by umardi_ on 5/16/2023 in #❓┊help
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
FFilament
Created by umardi_ on 3/20/2023 in #❓┊help
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
FFilament
Created by umardi_ on 3/15/2023 in #❓┊help
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
FFilament
Created by umardi_ on 3/14/2023 in #❓┊help
NavigationBadge count number refresh/poll automatically
Hi everyone, is there a way (built-in way) to make the count number of a badge at sidebar refresh/polls when there is update, without manually refreshing whole page? I can't find it on the documentation page. Thank you all.
13 replies