filament icon indicating copy to clipboard operation
filament copied to clipboard

Ability for Form Placeholder to poll

Open danharrin opened this issue 1 year ago • 4 comments

Discussed in https://github.com/filamentphp/filament/discussions/13459

Originally posted by SimonMacIntyre July 3, 2024 We make use of Placeholder in forms, to show data related to the entity. For example let's say we have an EditUser page and form.

We are using Placeholder as an example while viewing this page, to show some interesting live updating status about some thing based on this user. (Note: This is not suitable to be in a table/relation manager, we make heavy use of that too, but this specifically is a component we want to show right up in the form in a read-only fashion, but have it live-update).

Any chance of this being a feature we can add some day? Ideally it would be as simple as...

Placeholder::make('status')->poll(5)->...

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar

danharrin avatar Jul 04 '24 16:07 danharrin

cc @SimonMacIntyre

danharrin avatar Jul 04 '24 16:07 danharrin

I can make it work just by adding to the TextEntry the following trait:

use CanPollRecords;

And the corresponding polling validator in the blade view:

@if ($pollingInterval = $getPollingInterval()) wire:poll.{{ $pollingInterval }} @endif

https://github.com/user-attachments/assets/7e6d18ad-f3ac-4237-93b0-9355c5d2813e

However, it seems that Placeholder will be deprecated. Am I right?

Image

alvleont avatar Jul 22 '24 17:07 alvleont

Interesting, I'll give that a try, and also take a look at the TextEntry and if that is also pollable or not, thanks for the comment!

SimonMacIntyre avatar Jul 22 '24 17:07 SimonMacIntyre

It isn't. I mean, this is a code proposal for V4, but I guess I need some guidance before making a PR.

alvleont avatar Jul 22 '24 18:07 alvleont

This has been implemented as #14964 in v4

danharrin avatar Dec 02 '24 09:12 danharrin

@danharrin Hi! One more thing about polling is we need to have ability to poll a ViewPage including RelationManagers. For example I have getSubheading() on my ViewPage and I need to poll this subheading because it has important information.

But for now we do not have ability to poll Infolist or RelationManager page including subheading of this page.

indigoram89 avatar Apr 01 '25 12:04 indigoram89