Radical design and Herd Reverb

Download MP3
Announcer:

This is the Laravel News Podcast, your one stop podcast to find out about Laravel related news, tutorials, packages, and more. Here are your hosts, Jake Bennett and Michael Dyrynda.

Jake:

Hello, all you lovely people out there. This is episode 208 of the La Reveal These podcast. Today is February 13, 2024 or February 14, 2024 if you happen to be in the upside down Aussie land where it is already Valentine's Day, I hope you guys, you know, did your due diligence, Michael. Do you guys do Valentine's Day?

Michael:

We do. Yeah.

Jake:

I

Michael:

mean but we don't.

Jake:

You don't?

Michael:

You do? Australia

Jake:

does, but you don't. Yeah. That's just, you know.

Michael:

It's too hard to to put the children somewhere.

Jake:

I, you know, I struggle because it's like an opportunity to celebrate the people you love. Right? Which great. Any occasion you have to celebrate the people you love, you should definitely do so. However, it's also just a Hallmark holiday too.

Jake:

So I'm kinda like, you know, I just

Michael:

Yeah. It's a we on on the subject of it being too hard, we bought tickets to go and see Hamilton in Sydney for our 10th wedding anniversary this year.

Jake:

Yeah. There you go.

Michael:

And so we now have this plan in place to kind of break our children in into having sleepovers with Rhi's parents. So Mhmm. You know, we've got, 8 months to to kind of just so we're gonna try and do it, like, once a month between between now and October to to do that and, see where we land. Hopefully, it's okay.

Michael:

Like, they go over there. They love going over for a couple of hours in the afternoon. So overnight will be the the challenge. But The challenge. And They can keep grandma they can keep grandma up overnight.

Michael:

You know? Yeah. They don't go to sleep instead of Indeed. Myself.

Jake:

Yeah. You've got you've got, like, tons of family within, like, a minute and a half of your house. So Mhmm. Ree's parents, I don't know how far away they are. How far away they are?

Michael:

They're about 30 minutes. They're not too far.

Jake:

Okay. So so practically a world away compared to where all your family lives. You guys have, like, the Dyrynda block. Like, you guys literally own that entire block, man. It's kinda crazy.

Jake:

I went on a virtual Google tour last time we were on, a Laravel News podcast. I I I zoomed in to street view, and I got to see Michael's house and all of the relatives, and it was good times. I felt like I was a member of the family. Nothing to do with the podcast.

Michael:

We've had to move. We've had to move since then.

Jake:

He's like, he knows too much. Like, we're we're selling. We're selling. Oh, anyway, folks, we've got some releases, news packages, tutorials. Let's jump into it.

Jake:

10 dot 43. What you're here to hear about Laravel 10 dot 43 with support for stream JSON responses, passing a class name to register a global eloquent scope, menu insert or ignore using eloquent net method and more january 30th is when this one was tagged but there's some excellent features added that we wanted to highlight so here are the latest Laravel 10 release features. So Peter Elmerid contributed support for the streamed JSON response. This was added in Symphony 6.3. The benefit in this one is that there's less memory usage for large data payloads.

Jake:

So an example from the pull request is given where you can say return response and then stream JSON and then you pass back users and then arrow this yield and you're returning a generator. So that generator is then yielding, returning a set of users where you do, like, user query cursor and you kind of get these, lazy results that come back. And so it can, like I said, use less memory when it's retrieving these large sets of data. Along with the stream JSON method, you also get a new test helper to assert streamed JSON content. So you can say response assert streamed JSON content and then pass back what should be streamed through.

Jake:

Obviously, in your test, you're not going to have a massive data set, but you can still assert that the JSON content that's coming back is streamed. So you can learn more about the Symphony feature from their HTTP Foundation component documentation for streaming a JSON response, or feel free to just use that in your Laravel app today. Okay. So this new eloquent insert or ignore using method contributed by Trevor Morris basically allows you to bulk insert using a sub select, to be successful if there are key conflicts. So as we talked about this, this is using the new ignore, maybe not new, but ignore functionality for the connectors that support that ignore functionality.

Jake:

So it sounds like what this might do is in the case that you have a unique constraint on a table, in the case that a unique constraint is, is hit and there's a conflict, it will just silently discard those records, I believe, is what might be possibly happening here. Yeah. And so, yeah, at that first in the first insert or ignore using, you're passing the list of, those IDs or those unique constraints that you might have, the columns, and then the second one is where you're passing this sub select. If you've used the ignore functionality before, this might be a little bit more interesting to you, like, you've you know exactly kind of how this works. Sounds like you've got a nice first class method to do that with now, using the eloquent insert or ignore using method.

Jake:

So very cool. Very nice. Thank you, Trevor, for that one. New schema has index method. Heves Devandari contributed a schema has index method along with a few other methods that can be used.

Jake:

What this will do is it will check to see if a table has an index already. So you can say schema has index, you pass the table first, users, and then as a second argument you can say like my index name. So that would check to see if an index exists, on that table. You can also, however, pass the name of the column that you're looking for to see if it has an index. So you could say has index users and then pass email.

Jake:

Do I have an index on this email? Or you can check for, like, compound indexes. Do I have an index on name and title? And what type of index do I have? Is it a unique?

Jake:

Is it a primary? Is it a full text? So this has index allows you to check all of those different values in the case that you wanted to, I guess just inspect that, that that table. Check on the schema. So there you go.

Jake:

Using class names when adding global scopes. Eliezer Margarettin contributed the ability to pass a scope class name when adding a global scope to a model. So on a model, you can, inject into the booted method a static add global scope and then instead of passing a string, you can pass a class. The class would be ancient scope double colon class. In addition to that update, Eliezer contributed an add global scopes method then, which lets you register several global scopes at onceat once, I'm sorry.

Jake:

So, instead of add global scope singular, you can also say add global scopes, plural, and then pass an array of those different class names that will be global scopes that you'd be applying to that particular model. So that's pretty cool. There also is coming I think we talked about this a little bit today, Michael. Was it in Laravel 11 with the the, attributes? Yeah.

Jake:

The PHP attributes where it allows you to specify an attribute? Is that 11? Is that Laravel 11 that's coming in?

Michael:

Yeah. Laravel 11. There will be some new attributes to allow defining Like scopes. On your models. Yeah.

Jake:

Right.

Michael:

In a more sort of discoverable way.

Jake:

Yeah. Exactly. And so typically, you know, so in this specific example here, it's using the booted method. Then this is where you do some of these things, right, adding scopes, adding observers, those sorts of things.

Jake:

Right. And and so instead of having to do that, what you just do in this Laravel 11 is you can use a attribute, a PHP attribute, in order to do those things. So it's pretty cool, but that's not part of this. That's that's Laravel 11. Okay.

Jake:

A storage unlink artisan command, Mikhail Salkov contributed a new artisan command that deletes all symbolic links. So if you say PHP artisan storage unlink, that will do that for you, deleting all symbolic links that exist there. Okay. You can see the complete list of new features and the updates in the diff between 10421043 on GitHub, and then there is release notes directly from the change log in the blog post here, which we will share in the show notes as well. Thanks, Paul Redmond, for writing that one up.

Jake:

Alright. Onto the news. Michael, my friend, go for it.

Michael:

Excellent. First up, Laravel Reverb was renounced at Laracon EU last week at the time of this recording, which is a new first party web socket server for Laravel applications that brings real time communications between client and server to your application. So if you've used anything like Pusher before, if you've used Beyond Code's Laravel WebSockets, it's kind of a drop in replacement for that. So, it's built in a very similar fashion from what I can tell.

Michael:

That as the Laravel WebSockets package, where it's built on top of Ratchet. It is fine tuned for speed, and a single server can support thousands of connections whilst piping data without delay and inefficiency of HTTP polling. It provides seamless integration with Laravel's broadcasting capabilities, and there is first party support for Laravel Forge. It's built for scale and it because it uses the pusher protocol for WebSockets, it is immediately compatible with Laravel Broadcasting, if you're using something like Laravel Echo. So you can get more details on the Reverb home page, which is at reverb.laravel.com.

Michael:

I think it's still in the final stages of development and will be available free and open source soon.

Jake:

Can we do a quick aside on this just to talk about what what this is? I mean, I'm assuming probably most of the people who listen to this show know what WebSockets are, know what broadcasting is, know what echo is in Laravel. But in case you don't, when might you use this? So web sockets and pusher and all these different things are incredibly powerful. What this allows you to do is in the case that you want to kick off some process from the front end, but you don't want to necessarily have a blocking call made to the back end to do some process.

Jake:

What you can do is you can just sort of let your front end fire off. You can kick off a job in the background if it's gonna take a while, and you can let your front end sort of let the user know, hey, by the way, we're working on this. Right? You can shoot like a little spinner, can do a little yellow pulsing light, something like that. And then what you could do is on the back end, you can dispatch that job.

Jake:

Once that job has been completed, you can fire an event in the back end and say, my job, whatever job it was, has been completed. And on that job, you can say broadcasts and it will broadcast I suppose actually you dispatch an event that that event will broadcast. And what you can do is on the front end of your application using Vue or just plain JavaScript, you can say Laravel echo and then you can listen for that event on the front end. And then that front end, will catch that event that's happening because it gets broadcast from the back end using pusher connection or, in this case, reverb. It will catch that event and then you can update your front end UI using that so it's really really powerful it also makes it nice in the case that you have multiple users working off of a single dashboard or something like that.

Jake:

You can update all of those users at the same time. You can broadcast this event not only to 1 user, but you can also broadcast it to an entire group of users. You can use it for, like chat applications, or in in the case that we use it is we have a bunch of you workers, sorry, not workers, a bunch of team members working out of a shared queue. And when one of those queue items is completed, it disappears off that dashboard for everybody at the same time. You don't have to wait for them to refresh the page.

Jake:

You don't have to kick off a page refresh. It just disappears because it just it it uses the, you know, view on the front end to update that. So it's it's really, really nice, and with Laravel Reverb coming out, there's really no barrier anymore. If we're talking about, like, a $5 a month server and you already happen to be using forge, just spin up a new Laravel Reverb server, and you're good to go. So I'm really looking forward to using this one.

Jake:

Our Pusher bill isn't super hefty, but, we're probably paying $100 a month. So, I mean, if you could pay $5 a month and get 1,000 of connections, yeah, why would we why would we not do that? So yeah. Yeah. Thank you, Laravel.

Michael:

I think the the kind of background job thing is one example. The example that Joe gave when he demonstrated Joe Dixon demonstrated this at Laracon EU was basically to to build a Slack clone and to show how that kind of stuff works. Being able to send stuff to the server and then and get the immediate responses. I think the other thing that it kind of solves for is anywhere where you would poll the server. You know, back back in the day, in in quotes, we would, you know, have some jQuery process that would sit there and just ping some endpoint on the server somewhere, you know, every 5 seconds or or 30 seconds or whatever else.

Michael:

So this this basically allows you to just open a web socket and subscribe. And essentially, listen for things that are that are happening. It makes it really simple, so Yeah.

Jake:

That channel just stays open. Really simple.

Jake:

Yeah. Yep. Yep. So that channel just stays open and establishes as this connection, and then just waits. And then when a an event was pushed down, it's just real time pretty much.

Jake:

Pretty close to real time. Cool. Really nice. Really, really good stuff. I do wonder also I know on Pusher, there is a limitation on how much of a payload you can send through.

Jake:

Like, the size of the payload is limited. Yeah. With reverb, I bet you can crank that up. You know what I mean? Like, if you wanted to send a large amount of data through, you probably could.

Michael:

I assume it will be a WebSocket limitation more so than than, you know, implementation detail. Mhmm. But I

Jake:

mean, I'm sure there is a WebSocket limit. I think Pusher was pretty strict on how large of a payload you could send me. It's I it's definitely possible. I mean, it could also be both. Right?

Jake:

There may be a WebSocket limitation, but Pusher puts their own limitation on it because they don't want to be handling loads of data in these events either way don't know all conjecture at this point let us move on herd 1.4.0 is out with a new pro version and Windows in the works. Jordan, who you know, who I work with, was so excited to hear that they are going to be creating a Windows version of this. He was super geeked out, because, you know, setting up stuff to work in Windows is not always great, and there was no valet for Windows, really. There was some versions of it that you could kinda find around on the web, but there was no official valet version for, for Windows. Right?

Jake:

So Herd having a Windows version in the works is really, really exciting. So let's let's talk about this real quick. There are some new features, improving existing features, and it comes with Hurd Pro, which we'll talk about. Another huge announcement is a brand new Herd for Windows that is due out in March of 2024. So let's look at the highlights of the new version.

Jake:

There's also a video to go through all these and see Herd Pro in action. Now one of the things you can do is you basically have node version manager rolled into Herdna. So if you want to, you know, you have PHP versions that are installed that you can manage on a per project basis. You now also have node versions that you can manage on a per project basis. You can have 16 installed, 18, 20, 21.

Jake:

It will manage all of them for you. You can install them straight from within Herd, and then you can manage those in the environment, really really quickly.

Michael:

Even better even better than that, if you have a NVM RC file in your project Mhmm. When you switch into the directory, Herd will detect the version of of Node that you are using and it will just set it up. And if you don't have that version, it will install it for you. Which is really Incredible. Really good.

Michael:

Yeah. The the one thing that I had problems with was because I had NPM and Node and NVM installed on my machine already from brew, I had to go through and completely remove it all because herd will detect.

Jake:

Yeah.

Michael:

It will detect that you've already got specific environment variable set, and so it will assume that it is configured there. So that's that's one little thing that you need to do is basically just remove all of that stuff from your bash RC or or your z shell RC and things like that. And then and then it just works magically. It's the it's the first time that I've built our new front end on my machine locally since we started rebuilding our front end 6 months ago. So

Jake:

That's awesome. Yeah. Really, really cool. I mean, these are things these are those things that were just very difficult sometimes before. I will say valet used to break for me on a semi regular basis, not super regular, but semi regular.

Jake:

And, Heard has never had a problem for me, not one time yet. So I'm I'm really excited about that. A couple other basic updates. When I say basic, what I mean is non pro version updates. So there's an optional xdebug extension, so it will detect if you're needing xdebug and will only run it when you are asking for it.

Jake:

So in your PHP storm editor, you can, you know, put a breakpoint in, and it will load it up and run xdebug for you, which is, thank god, so nice, because that was always such a pain in the butt to set up for. There is a opt in beta channel, so you can get the latest updates as soon as they're out. There's also an option to disable notifications for PHP updates. So if you're like, nope. I'm not interested in any new updates.

Jake:

Just let me keep running. You can disable those. Also, there's an option to select your IDE so that you can quickly open a project from the site list in Herd. So when you click open, it'll either open in the PHPStorm or open in Versus Code or open in Sublime or whatever it might be. So let's talk about the new Herd Pro.

Jake:

So along with all the features of that basic version, the pro version includes some of these following things. So, dumps. So it will listen for dump or dd inside of your code and will display those in an external window instead of having to, get them in the in the web right there in your in your browser. It's going to kick them out to a new herd window, and you can see them nicely richly formatted in there, which is really, really cool. You can also catch a catch all mail that is coming from your app, by using the internal mail server and client to test and debug these local emails.

Jake:

There's also a log viewer, so it will trail and search sorry. Not trail tail, but it will tail and search through local log files for all your different projects, which is really nice. It gives you you know, sometimes it can be difficult when you're looking at those errors in the log to kind of see, like, what the data was that was coming through. You get that all now in a really, really nice view inside of, inside of Herd. And then again, I said that Xdebug was a basic feature, but it looks like it's included in both places, Xdebug as a basic feature and a pro feature.

Jake:

I believe it's a pro feature.

Michael:

It's both.

Jake:

I thought it was Is it both?

Michael:

It is both. So there's in the in in Herd Pro, there is a feature that that will just use the Xdebug less. So the version there there is 2 different PHP configurations, one with and one one without. Herd Pro will detect if you have made a call that requires Xdebug and it will and it will send the request to that PHP configuration that's got Xdebug. So all of your, you know, stuff that you're doing in the browser and all of your other testing will just be as speedy as Herd allows it.

Michael:

And it will switch if you need to. If you if you have the Herd basic version, you will need to turn the extension on and off yourself. So it's bundled in heard. The automatic detection and and and then channeling your request to the correct place happens only in the pro version.

Jake:

Very cool. Also, I feel like, you know, Marcel is the one who's been building Herd, with, like, Native PHP and all that good stuff. Yeah. He makes sense. Yeah.

Jake:

Items Yep. And some of these I feel like some of these items are coming over from some of the other products that he's created, using, you know, native PHP stuff or or whatever. I've maybe Electron, like the mail stuff specifically, looked very familiar. But it's cool. I mean, we I'm definitely buying a pro license have not bought one yet but we'll definitely be doing so and excited for all the new stuff I'll be getting because of that they're doing they're doing a great job working on this together So excellent job folks.

Jake:

Keep up the good work.

Michael:

Perfect. Let's talk about Laravel 11 a little bit. The first item we have here is that model cast will be moving to a method in Laravel 11. So in Laravel 10, model casts are defined using the cast array property in your models. So you can specify, you know, key value of the column name and then what it should be cast to an integer or a boolean or as an enum collection or whatever else.

Michael:

This, but but by moving this to methods, it opens the possibility to use, static methods built on casters, as well as defining some conditional kinds of functionality as well. So previously, you couldn't use as enum collection colon colon of user option. You can't define that inside of a property definition. You had to use the string concatenation to do that previously. So the update itself is backward compatible with Laravel 10, and you can still define cast using the cast property or the cast method.

Michael:

So you don't have to upgrade this if you don't want to when you go to Laravel 11. It's an opt in thing. But I think using the method is, is a really good way of doing it Just so that you can do conditional stuff, so you can call real methods on real classes and things like that without having to worry about concatenating strings and all that kind of stuff. So you can use, as collection using, as encrypted collection, as enum array object, all of this kind of stuff. And and as I said, being able to conditionally append things to that cast array, you know, you might want to cast something in a different way if you have an admin user logged in, for example.

Michael:

So lots of options are available to you by moving this from a from a property on the model and into a method. So definitely check that one out.

Jake:

Indeed. Very cool. I love that. And it's familiar too. You know, a lot of different items actually have, mod or sorry, methods that will allow you to specify those in a way that lets you break away from some of the limitations that there are on on properties.

Jake:

So that's really nice. Once, memoization helper is coming to Laravel 11. So this is, a function that was originally inspired by a tweet that Taylor put out and then Spassie and, Freak, of course, picked that up and said, hey, you know what? We should make a package out of this. And so now it's being upgraded to a first class citizen in Laravel 11.

Jake:

So what exactly does this do? This helper ensures that you always get the same value no matter how many times you call an object method. So the once function is helpful when you have some code that you want to ensure only ever runs one time. So, for example, if you have a class that has a method called UUID once, what you can do is you can return a once and then inside of that once you pass a closure, and then you have a value that's going to get returned, right? You call a UUID generator, essentially.

Jake:

And if you run a test that loops over and calls that same method like 6 times, it's not going to generate a new UUID each time. It's going to generate it once and then it's almost going to, like, cache that for the duration of that request or the duration of that test and return that same value each time you call that method again. So that's it's really interesting. I can think of a couple places I would want to do this. In specific, like, there is a client, an API client, that I just started, interacting with where you need to before you make an API call, you need to go and get a use your API token to create a new request token.

Jake:

And, you don't wanna do that every single time you make and I have to make an API call, but sometimes you have to make multiple API calls. So instead of going to do that each time, or having to check, did I call it last time? Do I have some value in the cash? Do I don't really want the cash to live for, you know sometimes you just do some stupid thing, like, let's set the cash for one second. Well, now you can just use this.

Jake:

You can just use once. And per, you know, life cycle of PHP comes up when you make a request. And then when it gets torn down, it flushes that, that once. Once double colon flush, is what will happen, and then it'll basically clear that out. So really interesting feature there.

Jake:

Thanks to Nuno Maduro who implemented this in pull request 49,744. That's how many pull requests we've had to the Laravel code base. Very, very cool.

Michael:

Alright. The last Laravel 11 item we have here is a new feature in Laravel 11 that will give us a health check endpoint in our applications out of the box. So if you have got your application behind a load balancer and you want to steer between endpoints or you're in an environment where you're spinning up, you know, your horizontal scaling with Kubernetes or some other container infrastructure, it's typical in those applications that you would create some kind of health check endpoint or in Laravel's case, this is called the it it it's slash up. And what it does is it will tell you whether or not that application is up. And it allows you to kind of steer traffic there.

Michael:

It's great for, if you're doing synthetic monitoring to determine if your application is up. You can get it to do all kinds of health stuff internally to determine what app is. So it may be that it checks that, yes, you are responding, but also that Redis is available, that the database is available, and things like that. And it'll return a 200 if everything's okay or some non 200 error if something is amiss. When you set up the application routing, the Laravel framework defines the health route and will also emit a diagnosing health event which you can hook into in order to configure as your applications, upstate to hook into that event as well for anything else that you need to do there.

Michael:

The default up endpoint can be configured as well and it returns a simple animated application up health page in the browser. So you can view it in the browser. You can use that as your health check endpoint for your load balances and any other kind of blue green deployment stuff that you might be doing. So definitely check that out. That'd be nice to have and and something that you won't have to implement, yourself.

Jake:

Exactly. I can get rid of, all the ones that I've implemented myself because this happens, you know, how many. I've got this on almost every single one of my applications where it's like a slash status button, it's like just returns like 200. Yep. Okay.

Jake:

That's all it returns is just okay. You know? I'm good. Good to go. Yeah.

Jake:

Very, very nice. Okay. Hey. Let's talk about radical design, shall we? So this is a new course by Jack McDade.

Jake:

If you don't know who Jack McDade is, he's the dude behind Statamic. He actually was very influential in a lot of the early designs for Laravel stuff. He was sort of, Taylor and him worked together on some, some products right at the very beginning of when Taylor was starting to build some stuff out. So Jack has, and he's also the founder of Statamic. He's launched a brand new design course that's called Radical Design.

Jake:

So this isn't like a book. It's not a step by step. It's self guided, sort of like a choose your own adventure deal. So if you know Jack, Jack likes to do things differently. Right?

Jake:

He just all of his websites are, I mean, he calls it radical design for a reason. Right? And this, design course is no different. Like, if you just watch the little intro launch, it's really funny. Jack has, like, a bunch of sticky notes on the wall, and he's like, okay.

Jake:

This is what we're gonna do. And he runs through all these sticky notes. It's really funny, and it's humorous, and it feels like I'm watching a show almost more than, like, I'm going into a, into some course. So Jack does a really good job on this. So here's here's what it is.

Jake:

Right? It dives into a lot of different areas of design. Video go videos, articles, tutorials. There's also downloads, example design files. There's elements, components, handcrafted SVGs, lots of other good stuff, but he's like, I'm sharing all my secrets, all the stuff that I've kept my personal treasure trove of hot links and bookmarks and all that stuff, font recommendations, asset libraries, etcetera.

Jake:

He's he's gonna share it all. So like we said, Jack has really got a, interesting design style that works well. His designs are always really unique and creative. If you go to the statomic website, you'll see exactly what I'm talking about. He talks a little bit about, like, the the value of humor in your designs.

Jake:

If you've noticed any of Adam Wathan's, and Steve Schoger's templates by the way, they do this as well. Right?

Michael:

So if

Jake:

you look at their

Michael:

copy.

Jake:

Templates that they have their their copy is just hilarious. It's very it's very fun, and it adds a lot of value. Right? So how do you how do you do this? How do you develop your own unique style so that your site doesn't necessarily look like everybody else's?

Jake:

How do you make it so that design isn't something that you dread, but it's something that you can get excited about and really, you know, look forward to. So, the course you can find at radical design course, dotcom. You'll get course access to the private radical design Discord server as well so you can collaborate, share ideas, and get feedback. And the course will be regularly updated with new videos and resources. I know Jack has been working on this one for a long time, actually.

Jake:

I'm really excited. Long time. Long time. I'm really excited about this, and I think he's definitely nailed it. So excited to check this one out.

Jake:

Congratulations, Jack, and, go buy the course.

Michael:

Awesome. Alright. One package this week. And this package is going to allow you to ask AI questions about your code base from the command line using the package called Laragenie. It's an AI chatbot with an Artisan console integration for your Laravel applications that can understand your source code by indexing directories and file paths.

Michael:

And you can then ask questions about your code such as describe all the model associations for the app model's post model. I won't go into too much detail here, But if that's something that is of interest of you, if you've thought about kind of building something, you know, funneling your application code into chat gpt or whatever else and then being able to do this kind of stuff, here is a ready made Artisan command for you. So you can definitely check that. We'll have links to that for you in the show notes.

Jake:

Awesome. Onto the tutorials, shall we? So we've got 4 different ones here. I will cover 1. Well, let's go let's go every other here.

Jake:

So make your app faster with PHP 8.3. If you didn't know, PHP 8.3 is the latest version of PHP. It has a lot of new features and improvements, and it's also quite a bit faster. So by upgrading to a 3, you can achieve a lot of increase in speed, and this article will show you how, using 8.3 can be a game changer by speeding up your application's performance. So it walks through different direct performance enhancements where you don't necessarily have to do anything.

Jake:

Also indirect performance enhancements where, it it improves syntax methods and type safety, and then how you can go about making your app faster with 8.3 by using some new features to build and ship faster, and then also caching strategies using HTTP2, optimizing your database queries, real time monitoring, with application performance monitoring tools. And so the really, really good stuff. You should definitely check this one out. If you're not using 8 dot 3 or even if you are using 8 dot 3, either way, there's some tips in here for you.

Michael:

Anyone that followed along with my journey of kind of redoing our test suite and and moving it from PHP unit to to using Pest. And how we kind of reduced it by from 6 minutes down to about 4 minutes. Just upgrading to PHP 8.3. So we were on 8.2. Upgrading everything to 8.3 and throwing that, you know, running the test suite at it.

Michael:

We got it down to under 4 minutes. So it's just you know, the magic and the performance and speed improvements of of the PHP language keep coming. Great. Yeah. The next article here is one from everyone's favorite human, Paul Redmond, that takes a look at the built in test methods in Laravel's test response class.

Michael:

If you read the documentation carefully, you'll notice that there are some useful helpers built in, and the class recently had some internal updates to the methods in the way of the Laravel 11 dumpable trait, which we spoke about last week. And so this, article is a good time to go through the test response class itself and revisit some of the useful helpers. Paul talks about dump and dump headers and dump session and and dd and all of the assertion methods like assert session has no errors, assert created, assert JSON, and so on and so forth. Have a look through this as a starting point. And then definitely go and check out the HTTP test documentation on the Laravel website.

Jake:

Very nice. If you feel like command line is only something you have to do and not something you really enjoy doing or something that you feel like you're particularly productive in, this tutorial by Paul Redmond, 5 tools that will make you more productive on the command line, is definitely a read that you should take the time to go through. So, he talks about fast node manager, talks about bootstrapping to your shell, and then all the setup steps that he does to make his shell really usable and customized to him. So he has an nvia, mrc file. He has his, he talks about z, zshrc file.

Jake:

He talks about auto suggestions, and then how to set all this stuff up, how you can use auto suggestions, and then a smarter CD command. I use j, which is really, really handy. I think it's just it's it's basically stands for jump. Right? So I can j and then I can type in any piece of any path that I want to and it will it will automatically populate that with, where I typically go.

Jake:

So if I want to, for example, go to an application in my, on my computer that has the word glacier in it. I type j glacierenter and it will automatically navigate to, you know, Jake Bennett sites glacier dot whatever, you know, etcetera. Mhmm. So it's it's really, really nice. He talks about Zox side, which is which is a smarter CD command, and talks about how you can set that up, how you can train it.

Jake:

He talks about fzf, which is a command line fuzzy finder, and what else he has here I think one other one fzf tab and I think that's the last one. So there's there's a bunch of them, them, a bunch of different tools. RipGrep is one other one that I did not actually come, that I did not actually look at, but he's got how do you how you go through all of these, why they're useful, how he uses them, and how you can set them up on your machine. So, Paul is definitely one of those guys where you watch him work, and it's you you're always, like, trying to figure out, hey, what is that tool you just used? I don't I don't know how how you do that.

Jake:

And so he's written it all up for us here. You should definitely check it out.

Michael:

Yeah. And the last article that we have here is 5 ways to be more productive with git. So this is talking about using the command line git, not using any kind of GUI or anything like that. He talks about the git nah alias and aliases in general. He talks about git forget, git uncommit, configuring git commit templates, and using password manager for SSH keys and SSH key signing.

Michael:

Which is something that I actually set out recently using one password and kind of putting all of my SSH keys in there. There was some discussion a little while ago around, you know, what do you do if you if you lose your SSH keys? And so putting them in in one password is a good way to to kind of protect them because it gives you a centralized sync location to do all that kind of stuff. So if you do happen to lose your computer or you need to, you know, reinstall, you don't have to go, oh, no. I forgot to to copy them or back them up.

Michael:

So that's that's great. There's the GitHub CLI tool, which is the GH tool that you can install using Homebrew on a Mac, which is very useful. I use it all the time for creating pull requests and things like that.

Jake:

Yep.

Michael:

And then using a git merge or a diff tool. So the git diff by default is not particularly readable, but there are a few different options available too that you can use, to to go through that kind of stuff. So I'll leave that up to you, dear listener, to go through Paul's article and and and have a bit of a look about that. But there's a lot of options there to make you more productive using Git.

Jake:

Yeah. One of the things that's cool on this actually is so the ones that I use the most often, is definitely, gh pr create. Right? So gh pr create will take the current branch that you have and then offer to create a pull request, against the master or whatever the main branch is for you. But you can also do things like, ghpr checks, which will allow you to see what automated checks you have running, on that pull request.

Jake:

And you can use dash dash watch to watch those checks until they finish, which is really cool. So if you're waiting for the test to pass or whatever, you can do dash dash watch and see if any of them fail so that you can get notified right away and and check what's going on there in, in your CI pipeline.

Michael:

Definitely.

Jake:

Very cool. That's it, everybody. That is all for episode 208. So let's wrap this one up. You can find show notes for this episode at podcast.laravel-news.com/208.

Jake:

Rate us up in your podcast of choice. 5 stars would be amazing. And, of course, hit us up on Twitter @michaeldyrynda @jacobennett or @laravelnews. Alright, folks. Till next time.

Jake:

We will see you later. Bye bye.

Michael:

Bye.

Creators and Guests

Michael Dyrynda
Host
Michael Dyrynda
Dad. @laravelphp Artisan. @LaraconAU organiser. Co-host of @northsouthaudio & @laravelnews. @thenpingme co-founder. Opinions are mine.
Radical design and Herd Reverb
Broadcast by