YouTubevideo· Jun 27, 2024· 2:19· 2,700 views on YouTube

Just "Use the Browser" with Laravel Livewire

Watch on YouTube ↗
0:00

React at a moment you like. The best moments light up here.

transcript

6 moments
  1. one of the concepts that seems to be getting a lot of traction is just using the browser using the web standards that have been uh implemented into the browser and even in your own language whether that's JavaScript or PHP and one of my favorite fun features in Live Wire

  2. is the wire confirm dialogue now this is not right having to write a single line of JavaScript instead you just get to use the web standards without having to write the web standard itself so let's imagine you have this button that just deletes everyone everything deletes your account deletes your data everything uh right now just you know just says good luck so if I accidentally click that uh everything's deleted but what can we do

  3. about actually you know making this a little bit safer while using the web standard of like a confirm dialogue box if you were to write this out in JavaScript it would take a little bit cuz you're hooking into like this this button and you're doing everything like that so it's as simple as typing in wire confirm and then here we can just type in whatever that confirmation dialogue asks so are you sure you want to delete

  4. everything so this is again just confirming this wire click action so if we were to take a look at what this looks like uh we click this are you sure you want to delete everything okay and then the actual action that you've set up in Live Wire again that's the this delete everything function actually runs so you just already have this kind of built out of the box with Livewire to use the web standard but the great thing is you can actually do more as well so

  5. if I was to um have a wire. confirm prompt which comes out of the box with larvo live wire and I was to say are you sure type delete to confirm and then anything past this pipeline is what you want them to actually enter into this prompt so refresh say delete everything

  6. okay are you sure type delete to confirm bam then it happens again one of my favorite features of Live Wire mostly just because it uses the web standard it uses what you're used to within the browser without having to actually write it yourself

just you here