Which Livewire method should I use?

Sdílet
Vložit
  • čas přidán 1. 07. 2024
  • There's multiple different ways to pass data from your server into your Livewire components template or view layer. But how are all of these methods different? How are they similar? Which one do I actually use to get the data in the way I want it?
    Well. Let's take a look. 👀

    Links:
    Livewire Lifecycle Hooks: livewire.laravel.com/docs/lif...
    Livewire Computed Properties: livewire.laravel.com/docs/com...
  • Věda a technologie

Komentáře • 27

  • @RobertCordes
    @RobertCordes Před 5 dny +5

    Please give us more videos with Josh on this channel! Love his content and style :)

    • @LaravelPHP
      @LaravelPHP  Před 5 dny

      Thanks for watching Robert! I'm glad I get to be a part of the team. :)
      -Josh

    • @vic_casanas
      @vic_casanas Před 4 dny +1

      Please 🙏 🙏🙏, I completely agree, his style is 👌

  • @xanthosoma1989
    @xanthosoma1989 Před 5 dny

    Thank you for this great video. I use Livewire in all my projects and it's amazing how I keep learning something new everyday.

    • @LaravelPHP
      @LaravelPHP  Před 5 dny +1

      It's really such a wonderful tool!
      -Josh

  • @neverything
    @neverything Před 4 dny

    Great video Josh, took me a while to figure out computed properties. Thank you for the refresher :D

    • @LaravelPHP
      @LaravelPHP  Před 4 dny

      So glad that it was helpful! I appreciate the support. :)
      -Josh

  • @kostaandonovski4633
    @kostaandonovski4633 Před 5 dny +1

    Great job man. Been using livewire for a few years now took me a bit to also figure out exactly when to use which, especially the render method because it re-computes at every single refresh making it not the best place to fetch data from. I always try to not place anything in the render method if possible unless its absolutely required for this reason.

    • @LaravelPHP
      @LaravelPHP  Před 5 dny +1

      It's definitely helpful to know all of these things so that way you can decide when you need data to be "fresh". So it's nice to be conscious of when you're making a ton of database queries like you said. :)
      If I'm having a CRUD setup where I want to refetch a list of items (much like a TODO list), after something has been added, having it in the Render is fantastic for that. But otherwise, it's probably not best, like you said. ☺️
      -Josh

  • @shubhamsahuSD
    @shubhamsahuSD Před 5 dny

    if i do something like this with alipine js, will it get updated value of entangled livewire variable
    Livewire:
    public $pageState = null;
    public function mount($state = null){
    $this->pageState = $state;
    }
    Blade:
    now will currentPageState have updated value or null ?

  • @diogocarlos9898
    @diogocarlos9898 Před 4 dny

    Thanks for this great video. But I have a question: if I use livewire volt using functions api, and I want to populate a table, what does it look like?

    • @LaravelPHP
      @LaravelPHP  Před 4 dny

      I don't know if I fully understand what you're saying, but that should be the with() function in Livewire Volt functional API.
      -Josh

  • @hafiznugraha3063
    @hafiznugraha3063 Před 5 dny

    What is the name of the extensions for tailwind classes that you use?

    • @LaravelPHP
      @LaravelPHP  Před 5 dny

      Thanks for watching! That is the Tailwind Fold extension for VSCode. It's something new I found. :)
      -Josh

  • @brianmweu6460
    @brianmweu6460 Před 4 dny

    Awesome.

  • @elmalleable
    @elmalleable Před 5 dny +1

    Livewire not having slots 😢

  • @fkarakas259
    @fkarakas259 Před 5 dny

    Hello, what is the name of the font and theme you use? Thank you

    • @LaravelPHP
      @LaravelPHP  Před 5 dny

      This is the Dank Mono font with Catppuccin Frappe theme. :)
      -Josh

    • @fkarakas259
      @fkarakas259 Před 5 dny

      ​@@LaravelPHPthank you :)

  • @berthojoris
    @berthojoris Před 5 dny

    Thanks Josh ^_^

  • @kantediakaridia
    @kantediakaridia Před 4 dny

    thanks

  • @sajsaj
    @sajsaj Před 4 dny

    Create some video about protected listeners, dispatch for new livewire developers.

    • @LaravelPHP
      @LaravelPHP  Před 4 dny

      Good notes! We will add it to the list. :)
      -Josh