Tetracyclic
formatStateUsing on simple repeater component
Is there a reasonable way to apply
formatStateUsing
to the component in a simple repeater, without reimplementing the logic in the repeater to format the array with UUID keys?
Applying it directly to the component fails, as formatStateUsing
/afterStateHydrated
are called on the child component before the repeater component is hydrated, so $state
is always null.
Applying it to the repeater itself requires reimplementing the logic in Repeater::afterStateHydrated
to assign UUIDs to each array, which seems fragile.27 replies
Require confirmation modal on submit action
Is it possible to trigger a confirmation modal from an action that submits a form? Adding
requireConfirmation()
appears to have no effect if submit()
is used. The docs only mention it not working when using a url()
action, but I assume the same is true with a submit()
action?
Reading through the source of Action
, MountableAction
, CanSubmitForm
and CanOpenModal
, I've not been able to figure out why it's not being called so far.5 replies
Stretch grid table row so that column actions sit at the bottom
When a table is displayed as a grid using
contentGrid()
, if the heights of each row box differs, the footer actions will stick to the bottom of the content, rather than sitting flush with the bottom of the box.
The obvious solution is to set the inner div immediately .fi-ta-record
that wraps the row to flex h-full items-stretch
(default is flex items-center
)
Is there a better way to apply these classes, than just manually targeting .fi-panel-app .fi-dashboard-page .fi-ta-record > div
with height: 100%; align-items: stretch
?
It doesn't appear to be possible to target this container with extraAttributes
.22 replies
Elegant handling of 419 expiry
Does anyone have an elegant solution for handling a 419 expiration in Filament? By default in Laravel, the CSRF token and session expire after two hours, which is extended on every interaction.
If the user leaves a page with no polling open for two hours (default expiry), or closes their browser, or puts the computer to sleep, when they return to the page they'll end up seeing a full page modal containing a 419 Expiry message, along with a JS popup saying the page has expired.
When they click to refresh, even if they're logged in with a "Remember Me" token, they seem to be logged out and directed to the login page.
16 replies
Select::selectablePlaceholder(false) not working with relationships
I have the following select component, which correctly displays as a list of the user's leads, with the first item always selected:
If
selectablePlaceholder(false)
is removed, it works as expected. With it in place however, it always fails the required()
validation, despite the option being selected. Removing required()
allows the form to be saved, but the lead_id
value is never persisted to the database.5 replies
defaultGroup set to attribute from parent relationship fractures group
Hi all, I have a Category model with a
parent_id
that can reference another category. This is only used for categories with a single level of subcategories below them.
If I set defaultGroup('parent_id')
it works as I'd expect, with the top level categories ungrouped at the top, followed by a group for each.
However if I set defaultGroup('parent.title')
the groups repeat themselves with only a couple of items under each level. There's no clear pattern to why they're grouped up separately, and in some cases it skips over a group until the next "cycle"
Expected:
Actual:
12 replies