YouTubevideo· Jun 4, 2024· 3:20

My First Livewire PR Got Merged...

Watch on YouTube ↗

transcript

9 moments
  1. so the new Livewire volt release that just got pushed today includes one of my very first PRS to Livewire volt library and that is the ability to make a class component with the PHP artisan make volt command if your project has already been scaffolded out using Breeze with Livewire volt the class API so let's see what this kind of changes it's just a quality of life update but something that I've desperately wanted and I was like hey why don't we build it so so uh

  2. if you were using Live Wire Vol before one of the things that I like using is the class-based API for example if I scaffolded out this Breeze project and it's using class base I like having the class stub automatically attached anytime I create a new volt component so if I was to go into the terminal PHP artisan make volt and I was to say this

  3. is like a playground component it's going to be created we'll go into playground but oops this is the functional API well okay it's not that bad I mean you could just erase this um and then you know have I think you I always have to look it's like okay it's using Live Wire bolt component and then you create new class extends

  4. component okay it's not that bad but it's still a quality of life buff that I would rather not have to do this or usually what I end up doing is just deleting and then I you know I rerun the command with dasht D- class okay that's not bad um but could

  5. we make this better for example in testing with live wire or with larel pest for example if you choose pest with Breeze um what happens is it will automatically check if you're using pest or PHP unit and any uh PHP artisan make

  6. test command will just use pest or PHP unit depending on what you're actually using for the project so can we do that with Livewire volt yes we can why don't we update to get the latest version of Live Wire volt so composer uh update Livewire slvt it's going to be version

  7. 1.6.5 and let's go ahead and check out what this does so now if I was to run PHP artisan make volt playground all of the sudden it scans and basically just says okay is there a component that is class-based if so let's use class if there's not then we're just going to default to the functional API so let's

  8. take a look and go to playground and look at that we have a class stub already to go for us so if you're using the functional base it's just going to use the functional by default but if for some reason you did want to create um a new volt component and you wanted this to be functional let's just say uh new playground you can pass in the functional class and that would be a created for you as well so hopefully a

  9. quality of life buff for those who have us who appreciate and love the class Bas uh structure within Live Wire volt now you don't have to remember to pass in that optional parameter of dash dash class so keep creating

just you here