Filament: Auto-Open Modal on Page with Default Action

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • A recently found undocumented Filament feature of $defaultAction.
    Original tweet: x.com/archilex...
    More Filament examples on our website: filamentexampl...

Комментарии • 19

  • @virgilc
    @virgilc Месяц назад +5

    This is a nice function to use for showing if there are any overdue invoices. Keep up the great work!

  • @saadeguilherme
    @saadeguilherme Месяц назад +3

    Hey Povilas!
    To open the action via the URL, the param is called `action` not `defaultAction`, so in your case it would be: ?action=newOrdersToday

  • @Aecy
    @Aecy Месяц назад +2

    combined with spatie flags, huge!

  • @theneverything
    @theneverything Месяц назад +1

    As always the right video at the right time. Thank you Povilas

  • @samuraidenis
    @samuraidenis Месяц назад +1

    Just what I needed, Thankyou Povilas

  • @ricko13
    @ricko13 Месяц назад +1

    thank you for the video, i didn't know that!

  • @PabloZagni
    @PabloZagni Месяц назад

    Yes! I'll use it, great!

  • @GergelyCsermely
    @GergelyCsermely Месяц назад

    Thanks

  • @HiWebGroup
    @HiWebGroup Месяц назад +1

    Maybe you have to add "Action" to the function name ?

  • @dissomedia
    @dissomedia Месяц назад +1

    It turns out, that you indeed need the property `public $defaultAction = 'newOrdersToday';`. Without that, the action is not fired. 🤔

  • @aleismasanchez
    @aleismasanchez Месяц назад

    Good! Is there a way to add an option to "Don't show anymore" in consequent visits to the page?

    • @Sh4d0wGu4rdian
      @Sh4d0wGu4rdian Месяц назад +1

      Since you control the function that executes the message, you could persist a variable that stores if it was displayed, so it wont display it the next time the page is lodaded. Keep in mind there will be an aditional query every page load. Cache could be a good use for this sort of check.

  • @ShagunStellen
    @ShagunStellen Месяц назад

    is it possible to do it in the dashboard?

  • @user-ez6zq4tk5d
    @user-ez6zq4tk5d Месяц назад

    i want auto open model for validation form

    • @krekas
      @krekas Месяц назад +1

      What do you mean?

  • @DmitryVerzhutsky
    @DmitryVerzhutsky Месяц назад

    Can someone help me? I need to catch closing modal event, i cant find it in docs

    • @krekas
      @krekas Месяц назад +1

      Source dive

    • @andrewwallo
      @andrewwallo Месяц назад

      If you find it let me know because I haven't found the correct way to do that. As far as I know, both the open and close events seems to be scoped to the modal document, it's not an event dispatched through Livewire.