DrByte
Tracking Read/Unread or Viewed/NotViewed
This is a how-to, not a help-request:
Tracking Views of a record, per user.
views
migration:
View
model:
User
model:
Post
model:
Then, for the component that "shows" the record, set its mountUsing()
to track the "view":
CSS can be used to set a class when the isViewed()
attribute is truthy.9 replies
Increase table->searchable() debounce from 500ms
I'm finding that when people use the Table-Column or Table-wide search, the debounce of 500ms is triggering a search much sooner than people are ready.
The component seems to have the debounce hard-coded, and no hooks to intercept it.
:wire:model.live.debounce.500ms="$wireModel"
https://github.com/filamentphp/filament/blob/6794c14765fc103defce60c5ae67033971b2425e/packages/tables/resources/views/components/search-field.blade.php#L25
Are there any workarounds someone can offer? Or is it only fixable by a core code change? (or the unthinkable importing of the component and overriding it in-app)?2 replies
trigger multiple downloads from a header Action button
I know I can't have 2
->action()
calls ... but how would I return 2 different Responsable
results to fire two separate downloads from clicking the Action button?
Calling either of these ->action()
calls works fine independently, but how can I combine them into one?25 replies
Password-less login via email link ... in v3
I've seen a couple v2 plugins for password-less login via a signed magic-link sent via email.
Looking for one that works with v3 ... because I've not yet been able to convert either of those to make it work.
ie: I've tried https://github.com/ArtMin96/filament-password-less and https://github.com/bradyrenting/filament-passwordless
17 replies
JS lightbox works in infobox but not in modal triggered by Table ViewAction in RelationManager
TLDR: This is about getting Filament's modal to properly call the js after the component is rendered to a modal.
(This is not about fslightbox itself: It's working fine in a "Page" rendered by Filament. But Filament's modals won't let it run properly. I'm trying to figure out why.)
Details:
So I've got this fslightbox component I created by cloning the SpatieMediaLibraryImageEntry component, and basically all it does is pull image URLs for full-size and a smaller conversion size, passing those to the template, and customizes the template to wrap the
<img src="(default-src)">
inside an <a href="(lrg-src)" data-fslightbox="lightbox">
element, so that fslightbox can identify the elements to attach itself to. So mostly just markup on the correct URLs to the image assets.
It all works great in InfoBox mode when the infobox displays as a Page. (ie: Admin Panel has an Entry Resource to manage the model's entries, each which has one or more images attached via SpatieMediaLib.)
So I know my component and template are working correctly.
THE PROBLEM
But I have another Panel where I display these Entry models as sub-records of Category models, and the RelationManager's "View" button fires the usual \Filament\Tables\Actions\ViewAction
... but only opens as a Modal, not as a Page, which is mostly fine for my needs, with one problem: The fslightbox
JS doesn't register these elements. (SYMPTOM: clicking the images opens the a href
URL directly, instead of firing the lightbox/gallery)
I'm presuming it's because the elements aren't attaching because the modal has created a shadow DOM?
I can go to the browser console and manually call refreshFsLightbox();
and the modal's images now work.
So that's a "start", but not a solution, not even a workaround.
How can I get the modal to run the lightbox js to register the elements itself after the Modal is rendered?22 replies