nuovo2023
nuovo2023
FFilament
Created by nuovo2023 on 1/27/2025 in #❓┊help
Custom Table Action and polling
I have a table that polls data every 5 seconds (and it's configurable), I added two actions to that table widget, a built-in one (a EditAction) and a custom that has a custom view and a trigger. For some reason the standard action is always click-able, meanwhile the custom action is not always clickable. Table widget:
...
return $table
->emptyStateHeading('No Active Calls')
->poll(config('widgets.poll'))
->striped()
->columns([
Tables\Columns\TextColumn::make('name')
->size(TextColumnSize::ExtraSmall)
->wrap()
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\Action::make('custom')
->view('filament.company.tables.modals.custom')
->visible(fn($record) => $this->spyVisibility($record))
->action((function ($record) {
Log::debug($record);
// This code is never executed
})),

]);
...
return $table
->emptyStateHeading('No Active Calls')
->poll(config('widgets.poll'))
->striped()
->columns([
Tables\Columns\TextColumn::make('name')
->size(TextColumnSize::ExtraSmall)
->wrap()
])
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\Action::make('custom')
->view('filament.company.tables.modals.custom')
->visible(fn($record) => $this->spyVisibility($record))
->action((function ($record) {
Log::debug($record);
// This code is never executed
})),

]);
And the blade view:
<x-filament::modal id="spy-modal" icon="heroicon-m-puzzle-piece" alignment="center" :extra-modal-window-attribute-bag="$action?->getExtraModalWindowAttributeBag()">
<x-slot name="trigger">
<x-filament::button icon="heroicon-m-puzzle-piece" x-on:click="window.dispatchEvent(new Event('js-modalopen-hndlr'));" />
</x-slot>

<x-slot name="heading">
Demo
</x-slot>
</x-filament::modal>
<x-filament::modal id="spy-modal" icon="heroicon-m-puzzle-piece" alignment="center" :extra-modal-window-attribute-bag="$action?->getExtraModalWindowAttributeBag()">
<x-slot name="trigger">
<x-filament::button icon="heroicon-m-puzzle-piece" x-on:click="window.dispatchEvent(new Event('js-modalopen-hndlr'));" />
</x-slot>

<x-slot name="heading">
Demo
</x-slot>
</x-filament::modal>
According to Filament documentation, that's all I need to add to make this work. The question is, what else should I add to the trigger in order to make it work?
36 replies
FFilament
Created by nuovo2023 on 1/20/2025 in #❓┊help
Unterminated string
No description
5 replies
FFilament
Created by nuovo2023 on 12/4/2024 in #❓┊help
Table widget
Hello, I am using the table widget and a custom query that is grouping data:
return $table
->heading('')
->defaultSort('start', 'desc')
->emptyStateHeading('No calls found')
->paginated([5, 10, 25, 50])
->query(
Cdr::where('dcontext', 'LIKE', $this->company->context() . '%')
->whereNotIn('lastapp', ['Hangup', 'Read', 'Playback', 'VoiceMail'])
->groupBy('uniqueid')
->select(
'uniqueid',
DB::raw('MIN(start) as start'),
DB::raw('IFNULL((SELECT GROUP_CONCAT(DISTINCT CONCAT(extensions.display_name, " <", cdr.vsip, ">")) AS vsip FROM cdr c2 WHERE c2.uniqueid = cdr.uniqueid AND answered="Yes" LIMIT 1), "-") as vsip'),
DB::raw('MAX(vclid) as vclid'),
DB::raw('MAX(vdst) as vdst'),
DB::raw('MAX(cdr.vdirection) as vdirection'),
DB::raw('sec_to_time(timediff(MAX(answer), MIN(start))) as vwait'),
DB::raw('sec_to_time(SUM(cdr.duration)) as vduration'),
DB::raw('IFNULL((SELECT answered FROM cdr c2 WHERE c2.uniqueid = cdr.uniqueid AND answered="Yes" LIMIT 1), "No") AS answered'),
DB::raw("MAX($recording) as recording"),
DB::raw("MAX(recordings.file) AS recording"),
)
->join('pbx.extensions', 'number', '=', DB::raw('cdr.vsip COLLATE utf8mb4_unicode_ci'), 'left')
->join('pbx.recordings', 'file', 'LIKE', DB::raw('CONCAT("%", cdr.uniqueid, "%") COLLATE utf8mb4_unicode_ci'), 'left')
->limit(10)
)
return $table
->heading('')
->defaultSort('start', 'desc')
->emptyStateHeading('No calls found')
->paginated([5, 10, 25, 50])
->query(
Cdr::where('dcontext', 'LIKE', $this->company->context() . '%')
->whereNotIn('lastapp', ['Hangup', 'Read', 'Playback', 'VoiceMail'])
->groupBy('uniqueid')
->select(
'uniqueid',
DB::raw('MIN(start) as start'),
DB::raw('IFNULL((SELECT GROUP_CONCAT(DISTINCT CONCAT(extensions.display_name, " <", cdr.vsip, ">")) AS vsip FROM cdr c2 WHERE c2.uniqueid = cdr.uniqueid AND answered="Yes" LIMIT 1), "-") as vsip'),
DB::raw('MAX(vclid) as vclid'),
DB::raw('MAX(vdst) as vdst'),
DB::raw('MAX(cdr.vdirection) as vdirection'),
DB::raw('sec_to_time(timediff(MAX(answer), MIN(start))) as vwait'),
DB::raw('sec_to_time(SUM(cdr.duration)) as vduration'),
DB::raw('IFNULL((SELECT answered FROM cdr c2 WHERE c2.uniqueid = cdr.uniqueid AND answered="Yes" LIMIT 1), "No") AS answered'),
DB::raw("MAX($recording) as recording"),
DB::raw("MAX(recordings.file) AS recording"),
)
->join('pbx.extensions', 'number', '=', DB::raw('cdr.vsip COLLATE utf8mb4_unicode_ci'), 'left')
->join('pbx.recordings', 'file', 'LIKE', DB::raw('CONCAT("%", cdr.uniqueid, "%") COLLATE utf8mb4_unicode_ci'), 'left')
->limit(10)
)
How can I limit the query, since limit is not working?
3 replies
FFilament
Created by nuovo2023 on 10/26/2024 in #❓┊help
Multi-tenancy title
Hello, I am using Multi-Tenancy, it's going great so far. I need to differentiate browser tabs by showing the current tenant in the title, for instance: Resource X - APP NAME - Company A Resource Y - APP NAME - Company B How can I achieve that without adding the code below to every resource I have?
php
Filament::getTenant()->name
php
Filament::getTenant()->name
6 replies
FFilament
Created by nuovo2023 on 10/12/2024 in #❓┊help
ExportBulkAction
No description
18 replies
FFilament
Created by nuovo2023 on 9/27/2024 in #❓┊help
Custom Action successRedirectUrl
Hello everyone, Is there a way to trigger succesRedirectUrl and successNotification after an action is successful?
12 replies
FFilament
Created by nuovo2023 on 9/13/2024 in #❓┊help
Help hiding artifact from Resource
No description
2 replies
FFilament
Created by nuovo2023 on 9/5/2024 in #❓┊help
Replicating and successRedirectUrl
Hello, I enabled multi-tenancy and I am trying to redirect to the edit form after replicating a record, I listed the routes and the one I need looks like this: GET|HEAD company/{tenant}/business-hours/{record}/edit ..................................................................................... filament.company.resources.business-hours.edit I'd beed trying to redirect to the edit form using this piece of code: ->successRedirectUrl(fn($replica) => route('business-hours.edit', ['business-hours' => $replica->id])), But I'm getting a Route not defined, Help please.
3 replies
FFilament
Created by nuovo2023 on 9/4/2024 in #❓┊help
FileUpload
First of all, thank you for the awesome job you've done with this framework. I have a form with a FileUpload control, I would like to delete the stored file once it is deleted from this control, What can I do to resolve this?
7 replies
FFilament
Created by nuovo2023 on 6/18/2024 in #❓┊help
Send Model to widget
Hello everyone, I need some help with this one. I made a custom page, that will have widgets, but I'm trying to reuse the same widget, and add one per client, that's not the problem. the problem is, How can I send a model to a widget in order to show relevant data? protected function getHeaderWidgets(): array { return [ CustomerStatus::make() // 1, CustomerStatus::make() // 2, ]; } The widget in mention is one based on BaseWidget, with a table in it. Thanks for the help.
4 replies
FFilament
Created by nuovo2023 on 6/13/2024 in #❓┊help
textarea
I have a resource called "Settings" iit uses a ManageRecords, and it works just fine. The thing is, How can I add an action to a external resource (named CompanyResource) that opens Settings Edit modal?
2 replies
FFilament
Created by nuovo2023 on 4/9/2024 in #❓┊help
Modal action polling
No description
6 replies
FFilament
Created by nuovo2023 on 4/4/2024 in #❓┊help
About Repeaters
No description
9 replies