Filament: Auto-Open Modal on Page with Default Action

Sdílet
Vložit
  • čas přidán 10. 09. 2024
  • A recently found undocumented Filament feature of $defaultAction.
    Original tweet: x.com/archilex...
    More Filament examples on our website: filamentexampl...

Komentáře • 19

  • @saadeguilherme
    @saadeguilherme Před měsícem +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

  • @virgilc
    @virgilc Před měsícem +5

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

  • @ricko13
    @ricko13 Před měsícem +1

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

  • @Aecy
    @Aecy Před měsícem +2

    combined with spatie flags, huge!

  • @PabloZagni
    @PabloZagni Před měsícem

    Yes! I'll use it, great!

  • @GergelyCsermely
    @GergelyCsermely Před měsícem

    Thanks

  • @theneverything
    @theneverything Před měsícem +1

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

  • @samuraidenis
    @samuraidenis Před měsícem +1

    Just what I needed, Thankyou Povilas

  • @HiWebGroup
    @HiWebGroup Před měsícem +1

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

  • @dissomedia
    @dissomedia Před měsícem +1

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

  • @aleismasanchez
    @aleismasanchez Před měsícem

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

    • @Sh4d0wGu4rdian
      @Sh4d0wGu4rdian Před měsícem +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 Před měsícem

    is it possible to do it in the dashboard?

  • @user-ez6zq4tk5d
    @user-ez6zq4tk5d Před měsícem

    i want auto open model for validation form

    • @krekas
      @krekas Před měsícem +1

      What do you mean?

  • @DmitryVerzhutsky
    @DmitryVerzhutsky Před měsícem

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

    • @krekas
      @krekas Před měsícem +1

      Source dive

    • @andrewwallo
      @andrewwallo Před měsícem

      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.