nowak
How to use CreateAction for a resource in an unrelated resources table headerActions?
I have recently experimented with adding a CreateAction to a resource tables headerActions, but this fails as I get the error:
But I was able to add my CreateAction to the ListResource pages getHeaderActions() method, like so:
Would it be possible to add the functionality of this action to the tables headerActions instead of List page header actions? The main reason for me wanting to move the the table header, is for the placement in the UI, to avoid having the action buttons spread out too much.
2 replies
How to add a CreateAction in the headerActions of resource A, to create a record in resource B?
I want to allow users to easily create a record in resource B, on the List page of resource A in its tables headerActions. I would also prefer to use the existing form from resource B as well as it's create lifecycle hooks, if possible. Basically, I want to open the existing create page of resource B in a modal by clicking an action button, which does the exact same as the existing create page does.
Is this possible?
I tried to use Filament\Actions\CreateAction on a tables headerActions just to test if this would open a create modal when clicked like this:
But this gives this error:
23 replies
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:
As:
How can we remove this action from the createOptionAction modal?
10 replies
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:
Is this how it is supposed to be, or is this a bug?
6 replies
Show navigation and topbar conditionally
In my panel provider I am disabling the navigation and topbar like this:
Since I actually only want to do this for specific roles, I wonder if there is a way to set this conditionally?
This does not seem to be working:
10 replies
I get Class "App\Filament\Pages\Dashboard" not found after removing Dashboard on Production
I wanted to create a custom dashboard instead of the default panel dashboard. I named my custom dashboard class something other than
Dashboard
, which I had no issues with when developing locally. Then when pushing my changes to Production (Staging environment), I get the Class "App\Filament\Pages\Dashboard" not found
error.
Has anyone else experienced something similar? It is very strange that I get the error on production but not locally.25 replies
In a iconButton action, is it possible to make the iconSize larger than Large without using css?
I have this view action:
When setting
->size('xl')
, this is macthed in the icon-button.blade.php
to the icon size Large
, which is h6 w6
.
This is a bit too small for comfortable touch usage, where the minimum size of h10 w10
is recommended.
So is there a way to either add an extra attribute to the svg icon element, or set the size of the icon to 40px
somehow? Or are we limited to the Filament\Support\Enums\IconSize
enums?4 replies
How to set ->recordAction(null) and ->recordUrl(null) conditionally in custom column?
I am working on a custom column class and view, which should function as a confirmation slider. The issue is that when I drag the slider handle and release outside the slider component, the record row is receiving a click, which triggers the table rows recordAction. I could set ->recordAction(null) and ->recordUrl(null) on my table, but I might not always want to disable row clicks on all tables that use this custom column.
So I was wondering if I could somehow conditionally set the recordAction table prop to null when my slider is in the dragging state, to avoid the record click being triggered while interacting with the confirmation slider?
5 replies
Browser refresh not working in new panel
I have created a new panel in my filament app on top of my admin panel.
I have added a resource to my new panel, and it seems to work well. But I noticed that when I update my new panel resource code, the admin panel browser tabs are refreshing, but not my new panel browser tabs. So it seems I need to make an extra step to get browser refresh to work with my new panel when vite hot reloads.
I could not find anything about this in the Filament documentation, any help is much appreciated.
35 replies
How to avoid showing all widgets on all dashboard pages?
Hi, I want to create multiple dashboards, each with their own specific widgets. I have this kitchen dashboard for example:
This dashboard shows all my widgets in
app/Filament/Widgets/
, as if BaseDashboard
automatically fetches and returns all existing widgets. How can I avoid this, and select which widgets should be shown on which dashboards?38 replies
Duplicate notifications from table action on page load
I have a UserOrderResource, where I have added a table action that navigates to the GroupOrderResource record for each UserOrder record:
I tried to add the conditional logic and notification to
->before()
, but it was ignored entirely and when clicking the action, so I added this logic directly to the ->url()
method.
But I experience some strange behaviour, as these notifications are sent when the table is loaded, which makes sense as the url is generated before the action is clicked. But each notification is sent twice, which is odd to me.
Is this due to my action code, or is filament triggering the action code twice on page load?2 replies
Is it possible to add validation to a `Action::make()` before opening the confirmation modal?
I have added a header action to my table, where I have tried to add validation in the
->before()
lifecycle hook:
But the before hook does not trigger before the confirmation modal is opened. Am I doing something wrong? Or is there simply no lifecycle hook that triggers before the action modal is opened?7 replies
How to add `created_at` column with `sortable()` to `BelongsToMany` RelationManager correctly
I have a RelationManager with a
BelongsToMany
relationship, and both the pivot table and the relationship table has a created_at
column. I try to add the column to the table like this:
This shows a date column in my table as expected, but when I try to sort the table by the created_at
column, I get this Ambiguous column
error:
How do I make sure that the table uses the created_at
column from the users
table when sorting?19 replies
Did the mount() method get removed from Widgets?
I am using the #google-maps plugin where I have created a "custom" MapWidget, which used to update whenever the data was updated, but now this does not work anymore.
So I found out that the
mount()
method in the vendor/cheesegrits/filament-google-maps/src/Widgets/MapWidget.php
class is not being triggered anymore, and thought that this might be related to a recent Filament update affecting this, since this used to work.
So should this method:
still fire in classes that extend the Widgets\Widget
class? Or is this no longer the case?4 replies
How to set default date in DatePicker form field in filtersForm?
I have a custom dashboard class, where I want to add a filtersForm, with a date field that should default to todays date (now()), but the default is never being set in my form when I try to do this:
I have attached screenshots of my form field when null (on page load) and when I select a date.
Does anyone know how I can set the default date correctly?
3 replies
Slow action modal opening times on resource table
I have a GroupOrderManagementResource with a table, which has actions that use my GroupOrder model records in it's functions. Opening these actions seems to take too long (3+ secons), and I was wondering if I am doing something inefficiently when it comes to using the Resource model records in the table? So my Resource setup looks like this:
Then I define my table query like this:
Where I am wondering if I am using eager loading correctly?
And finally, I have a
note
TextColumn, that I have added an action to with a form to add/edit the note for a record:
Any insight is highly appreciated!
Thanks!27 replies
Duplicate and missing records/rows when navigating table pages
I was looking for a record in an "Orders" table, that I new existed, and I wasn't able to find it while navigating the 10 record per page table pages. I then set the table to show all records, which revealed the record I was looking for. Also, when navigating between pages, I see the same records on different pages (see screen recording)
When setting a filter for the order date, for some reason, the record shows on page 2 when navigating the table pages, and the same records don't appear on different pages.
Does anyone know why this is?
2 replies