Filament Repeating Code: 2 Refactoring Examples

Поделиться
HTML-код
  • Опубликовано: 20 дек 2024

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

  • @edgarteichert5587
    @edgarteichert5587 День назад +1

    Hi, there. It's also possible to put the closure in the function itself. Then one just needs to put the function name in. E.g.
    ->afterStateUpdated(static::updateTotalCost())
    then
    return fn($set, $get) => doSomething()
    in the function itself. Even less code and nice look.

  • @faridmoreno2864
    @faridmoreno2864 2 дня назад

    Thank you for those tips! I have a question: How Can I put the some logic (total_cost) in a service class? Because, I want use this logic in other system parts :D

    • @FilamentDaily
      @FilamentDaily  9 часов назад

      Well yeah, create a service class and put a function with parameters in there, not sure what is the question here :)

  • @archiealvarado8831
    @archiealvarado8831 2 дня назад

    I am learning Filament. It is just a Livewire with the shortcuts. Is it still relevant in the future because it looks like low code programming. Should I master it? Here in the PH nobody uses it.

    • @FilamentDaily
      @FilamentDaily  2 дня назад +4

      It depends on what projects you wanna work with. For each kind of projects, there are different languages and frameworks. Filament definitely has its niche. The question is do you see that niche and wanna be part of it.