Close modal from a "extraModalFooterActions"
I have a table with a
Filament\Tables\Actions\Action
action that opens a modal. This modal also has a extraModalFooterActions
action which works as expected. I want the modal to close when the extraModalFooterActions
action is completed, how can I go about this?
I can't seem to find a way to give the modal a custom ID or retrieve the modals ID to be able to dispatch a close event.
This is my current code:...Solution:
I think you just need to use makeModalSubmitAction() here. have you read this:
https://filamentphp.com/docs/3.x/actions/modals#adding-an-extra-modal-action-button-to-the-footer...
Show both an infolist and a form on a RelationManager modal
If I define infolist() on a RelationManager class, I get a modal with an infolist. If I define form() I get a form. But if I define both, I don't get both but only the infolist. Any quick fix for this? Do I need to override the view for this or is there a simpler solution?
Solution:
Looks like I need to override the view as this is an elseif
https://github.com/filamentphp/filament/blob/3.x/packages/actions/resources/views/components/modals.blade.php#L111...
Add a trait to every filament page
My project is entirely filament. I recently discovered a package that wants me to use a trait in each of the Edit, View, List or Create pages. Is there a way to boot every page always with that trait?
How to remove createAnother button from createOptionAction modal?
In a Form Select field, when I want to add the abilitiy to create another option on the relationship, it only makes sense in some cases to add one extra option that needs to be selected by the select field. Here I do not want to see the "Create & create another" action in my modal, as this only confuses the end user.
This does not work:
```php
->createOptionAction(function (Action $action) {...
Solution:
Okay, so that cleared it up. in the
getCreateOptionAction()
method in the filament/packages/forms/src/Components/Select.php
class, an extra modal footer action is added conditionally:
```php
->extraModalFooterActions(fn (Action $action, Select $component): array => $component->isMultiple() ? [
$action->makeModalSubmitAction('createAnother', arguments: ['another' => true])
->label(__('filament-forms::components.select.actions.create_option.modal.actions.create_another.label')),...Searchable MorphTo
I want to make a column searchable:
```TextColumn::make('model.name')
->url(function (BankAccount $record): string {
if ($record->model instanceof Project) {...
Solution:
Having a relation named 'model' seems like it might break something, or at the very least be confusing. I'm not sure on your specific error here, but you can pass a closure to searchable() and override the query to search specific columns of your MorphTo models.
```->searchable( query: fn ( $query, string $search)
=> $query
->orWhereMorphRelation(...
Missing understanding about mutate data in repeater
can anyone explain about how to use three of above in repeater
- mutateRelationshipDataBeforeCreateUsing
- mutateRelationshipDataBeforeFillUsing
- mutateRelationshipDataBeforeSaveUsing...
Solution:
Before create = adjust the relationship data before creating the records in the relationship
before fill, is before filling the data into the form from the relationship
before save, is when saving the data in editing etc....
Rendering widgets on multiple dashboard
Hi everyone,
I'm working on a Filament project with two separate dashboard pages under the same admin panel:
/admin/dashboard
for general dashboard widgets...table filter icon - add text after or before icon
Hello,
Is it possible to insert text next to or before the table filter icon?...
Solution:
```php
$table
->filtersTriggerAction(
fn (Action $action) => $action->button()->label('New Filter Name')
);...
Repeater
I want to create two repeaters linked to a single table. For example, I have a transaction form, and within this form, there are sections for both the buyer and seller. I am using repeaters for both the buyer and seller, but they both point to the same table, "Contact."
How can I map the relationships when creating and retrieving data, considering that the buyer and seller are both stored in the "Contact" table but are distinguished by a "type" field?...
Export Action custom Query
Good morning everyone, but does anyone know how to solve the problem of export actions on custom queries? I noticed it’s a widespread problem. My query contains a groupBy.
Filament Spatie Translatable & Filament Spatie Tags
Hi,
are these two plugins not working together? I cant get that to work, when I follow the documentations. Translatable is also not working with the normal .
Any suggestions?...
Filament\Forms\Components\TagsInput
Filament\Forms\Components\TagsInput
Polling step wizard
I'm making a wizard to connect to Google Analytics, and the first step contains the connect button. The authorization screen to obtain the analytics accounts opens, and what I want is that when I close this screen, I want to automatically go to step 2, which is a select to select which analytics account will be used, and for this I have thought about the first step having a poll. Is this possible?
I attach steps image, and this is the code
```php...
Page header in topbar
I want to move the page header (the one with breadcrumbs, title and actions) in the topbar.
I managed to extend some fiels (layout, topbar etc) in order to add the header but I can't seem to make the actions work.
Is this the way to do this. Is there another way i can accomplish this?...
Query builder operators for TextConstraint
In doc Query Builder #text-constraints I see that I can use
By default, the following operators are available: Contains - filters a column to contain the search term...
Solution:
Ufff.
What a pain to find it.
Also if continue way of code
->operators()
and his getter getOperators()
I see the class Operator
...Show confirmation modal with onchange event?
I wanted to show a confirmation modal while user try to change a select field. Can anyone help me to find the documentation or any tips for me?
Solution:
Install Plugin
Hello, I need help installing plugins in Filament. I would like to install this plugin:
...
https://filamentphp.com/plugins/joaopaulolndev-edit-profile
https://filamentphp.com/plugins/joaopaulolndev-edit-profile
Database notifications panel stays open after clicking ->url() notification action in spa mode
I recently enabled spa mode on my filament admin panel, where I have noticed that the database notifications panel stays open after navigating to a resource page from a notification url action. Also it seems like the css sometimes (at random it) does some weird stuff causing some elements in the navigation sidebar to flash when clicking the notification action buttons.
I have attached a screen recording of the issue.
And here is the code for how one of these notifications are created:
```php...
Solution:
The bug is spa mode. All it does is set the wire:navigate on links. You would have to explicitly tell every action to close the modal with a live event listener. Long story short spa mode in livewire isn’t solid yet and if you need an actual spa then you need to build one. Otherwise let livewire do what it does. 😅