Advanced Livewire: A better way of working with models

By @samuel · 5 days ago

Advanced Livewire: A better way of working with models

  • By @edalzell · 2 days ago

    Why the __ in $this->__user? Is that a Livewire thing?

    • By @samuel · 2 days ago

      No, it's just to distinguish the value from properties, in case both a property and a method with that name existed.

      You can create runtime properties in Livewire, and they won't be included in the frontend data.

      That said, the post has a slight issue. The ??= doesn't work since Livewire overrides __get(), so isset($this->__user) ? $this->user : ... should be used.

      I'll be editing the post later today to fix this + mention some additional improvements.