Which Livewire method should I use?
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
Please give us more videos with Josh on this channel! Love his content and style :)
Thanks for watching Robert! I'm glad I get to be a part of the team. :)
-Josh
Please 🙏 🙏🙏, I completely agree, his style is 👌
Thank you for this great video. I use Livewire in all my projects and it's amazing how I keep learning something new everyday.
It's really such a wonderful tool!
-Josh
Great video Josh, took me a while to figure out computed properties. Thank you for the refresher :D
So glad that it was helpful! I appreciate the support. :)
-Josh
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.
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
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 ?
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?
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
What is the name of the extensions for tailwind classes that you use?
Thanks for watching! That is the Tailwind Fold extension for VSCode. It's something new I found. :)
-Josh
Awesome.
Thank you! :)
-Josh
Livewire not having slots 😢
Hello, what is the name of the font and theme you use? Thank you
This is the Dank Mono font with Catppuccin Frappe theme. :)
-Josh
@@LaravelPHPthank you :)
Thanks Josh ^_^
Thank YOU for watching!
-Josh
thanks
Thank you for watching! :)
-Josh
Create some video about protected listeners, dispatch for new livewire developers.
Good notes! We will add it to the list. :)
-Josh