Really eager loading, Larabelles, and whispy SSH servers

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.

Jake:

Podcast. The date today is 04/14/2025. If you have not yet filed your taxes and you are really tired of those tax ads like the rest of us are, you have one day left in The US to complete those taxes. No pressure. By the time this podcast comes out, it is too late.

Jake:

You have got to pay taxes and penalties or, you know, penalties and all this. No. You don't. You could file for an extension. You're fine.

Jake:

You're fine. Let's not talk about that, shall we? Let's let's talk about something a little bit better. Our sponsor, CodeRabbit, which we're gonna talk about a little bit later in the show, which makes your job as a developer so much easier because you can cut code review times in half. I'm so sorry, Michael.

Jake:

I forgot to introduce you. Michael Dorinda, ladies and gentlemen. Let's give it up for Michael.

Michael:

Look, if you wanna just take this one, I'll I'll just sit and watch. That'll be fine. That'll be fine.

Jake:

Nope. Nope. Nope. Absolutely not. You are the you are the brains behind the operation here.

Jake:

I'm just the I'm just the color man. Is that what they call it? Like, the the guy who just adds the, you know,

Michael:

hype man.

Jake:

The hype man. I don't know what they call it. Color commentary. That's color commentary, I think. Right?

Jake:

So Mhmm. Hey. So I've I I'm really I think you and I are in a good place right now regarding weather. Right? Like, it's getting warmer for me.

Jake:

It's getting a little bit cooler for you, and I think we're kind of at that equilibrium point where, like, we're both kinda probably happy with where things are right now. How how are you feeling about that? Yeah?

Michael:

I mean, it's basically still summer here at the moment. I've got I had the air conditioner on because it's it's still 30 degrees Celsius just this last Celsius. Four, five days. So I reckon seventy, seventy five in in

Jake:

86.

Michael:

In the ballpark there? Eighty six?

Jake:

Eighty six Fahrenheit. Yep. So that's pretty toasty.

Michael:

Yeah. It's still I don't know. It it started to turn into winter. It's still chilly in the mornings. But Mhmm.

Michael:

Mhmm. Yeah. It's it's definitely You

Jake:

got running?

Michael:

Yeah. Yeah. I went got the five in this morning. Keep Nice.

Jake:

Do so do you run five miles? Five miles or five k?

Michael:

Five kilometers. Yeah.

Jake:

Which is Okay. Is. Well, still, it's three miles. That's still I mean, that's still respectable, dude. I mean, I'm not out there running three miles.

Jake:

Gosh.

Michael:

No. Yeah. I do I do five five and eight. And I went to see the doctor a couple of weeks ago, and he says, how much exercise are you doing? I said, oh, I run like three times a week, you know, five to eight k's.

Michael:

And he goes, okay. That's that's like a high level of exercise. And I'm here I am thinking, you know, I'm not doing that much. And the doctor's like, no. That's that's what we would consider like high level.

Michael:

I'm like, okay.

Jake:

That's freaking plenty. My gosh. Three three so for me, three miles three miles is probably like five miles. My gosh, bro. No.

Jake:

I'm not doing that. Oh, nice. Going for a swim. Alright.

Michael:

Taking up the swim and getting better getting better. Still, I think I'm I'm getting the breathing. We a couple of weeks ago, we we kind of my instructor and I kind of came to the conclusion that maybe I've got this subconscious fear of drowning because

Jake:

Okay. Okay.

Michael:

Trying trying to do freestyle by myself. If I turn my head to breathe, I'll, like, open my mouth, but I can't it's like I'm still holding my breath with my mouth open, so I can't get the air in. But as soon as I get the little paddle board out there, no problems. So it's just like this subconscious thing that I've gotta work through, which is like if you haven't been swimming for twenty years and you don't spend a lot of time in water Mhmm. It's, you know, it's just some unlearning.

Michael:

And and I think the other thing is the the breathing for swimming is kind of the opposite to running. So I've done a lot of running. Running is breathe in through the nose and out through the mouth, whereas swimming is in through the mouth and out through the nose.

Jake:

That's Yeah. That's actually very true. Absolutely.

Michael:

Takes some some thinking.

Jake:

So Good point.

Michael:

Getting there. Getting there. Just it's, you know, repetition now and practice. And now I've got I've got the technique. It's just a matter of just doing it over and over again.

Michael:

So I I spent, like, 300 meters last year, and it's like, oh, you know, that's eleven minutes per hundred meters or something like that. I'm like, I could run exhausting. Twice twice as fast in half the But, yeah, it's it's the impact stuff. Right? It's not impacting on my joints, my hips, my knees, my ankles, you know, all those things that are bugging anyway.

Michael:

So

Jake:

So I used to be a pretty I thought I I used you know, my dad was a swimmer growing up. And so he taught us how to swim all me and me and my brother since we were very competitive. You know, we'd like to swim and race each other, and we grew up on this, like you know, we had this little pond lake in our neighborhood.

Michael:

Mhmm.

Jake:

And we would go swim I mean, all summer, every day. Every day

Michael:

would be So

Jake:

I considered us to be pretty decent swimmers. And, you know, we we all probably were decent. Well, there's we were seeing some friends in Arizona, and I was their their daughter swims. So she's, like, 14. I mean, like, whatever.

Jake:

14 year old kid. Yeah. Well, I mean, competitive. Yeah. She swims from school or whatever.

Jake:

Yeah. Yeah. I'm like, how good can she be? Right? Let's let's do, like, a lap down and back.

Jake:

Like, there was we we were at this pool where they had, like, lanes, you know? And I was like, oh, I'll take you on. Let's go. And she's, bring it on. Let's go.

Michael:

See you later.

Jake:

She smoked me. Smoked me, dude. I mean, not even close. Like like,

Michael:

beat

Jake:

me by, like, half a lane. I don't even know how long those things are, but just destroyed me. I was so out of breath. Oh, it was terrible.

Michael:

It was terrible. When they do it all the time, you know, it's it's very different. Like, even watching some of the other people that are just there casually swimming while I'm flailing in the pool, and it's like, okay. Like, I have no I don't really wanna be quick. I just wanna have the stamina to

Jake:

Smooth.

Michael:

Yeah. You know,

Jake:

like, don't wanna look like yeah. You don't wanna look like a moron out there. You just wanna be like smooth and steady and whatever. Yeah. Yeah.

Jake:

Totally.

Michael:

Yeah.

Jake:

Man. That's crazy. Alright.

Michael:

Well, thanks for checking out the Larabelle swim podcast.

Jake:

Yep. Yep. Until next time, folks. We'll see you later. You know, honestly, I have a feeling like people people like like that part of things.

Jake:

You know, it it I think it humanizes everything. You know, everybody we're all here. We're all here to kinda, you know, hear about what's going on in everybody's life. So hey.

Michael:

And you what? People don't like it. We chapter mark the the podcast, and you can skip out of the preamble and straight into the the Larapo or specific stuff if that is your preference.

Jake:

We actually do. And you know what? I gotta give a quick shout out because we we posted about our other podcast recently, and we actually had a couple of people respond. So Sid and Andrew Minion actually reached out and and gave some answers to some questions we were asking. So if you'd like to say something, feel free to hit us up on Twitter, and we'll we'll shout you out on the show.

Jake:

Always love to hear from people. Hey. With that being said, so we get into it. We got a couple releases, some news, some packages, all the good stuff. Alright.

Jake:

Rock, paper, scissors. Let's see who goes first. Here we go. Ready? Rock, paper, scissors, shoot.

Michael:

Oh, I

Jake:

win. I win. I got the scissors. You got the paper. Here we go.

Michael:

The scissors?

Jake:

I got the scissors. Laravel team released 12 dot seven dot o recently, which includes two excellent new features, resource helper functions for models, and a where attached to Eloquent method. Tim Kunze contributed helper methods. They'll make generating resource instances fluent using an Eloquent model or collection. So before, you would have had to do user resource colon make and then user find one.

Jake:

So you have to pass that in there. Or if you wanted to do a collection resource, user resource, dot dot collection, and then you pass in that group of users that you want to do as a collection. Well, no longer. Now you can do user find one to resource. So you can just use that model and then to resource the thing, specifying what resource you want inside of that method.

Jake:

So to resource, parens, user resource class. Similarly, same thing if you're in a query already, user query, give me the active ones, paginate them, arrow to resource collection. You can also call to resource without any arguments, and the model will guess the resource name. Of course, you can be explicit and pass a resource, but when you're using Laravel conventions, it can typically be omitted. This is a lot of places we have this in the framework, right, where it will automatically know what you're trying to look for.

Jake:

Same thing with, like, factories and things like that. It will automatically give a really good guess as to what you're attempting to get to and fill that in for you. So very nice there. Thank you so much, Tim Kunze. Jacob Baker Kretzmar contributed a where attached to Eloquent query builder method to simplify retrieving records attached to a model via a belongs to many relationship.

Jake:

So before, what would you would have had to do is post DODOP where has tags and then query where key tags. And so now you can just do where attached to tags, post where attached to tags. And then with an explicit relationship name, you can pass that as a second param if you've, you know, similarly, again, it's going to try and guess for you what relationship you're asking for there. But if you wanna be specific, you want to be explicit, you can be bypassing that relationship name as a second argument to that where attached to method. So just a little bit of simplification there.

Jake:

Making the URI class macroable. We've seen this across many of the different classes that we have in the Laravel framework now. Of course, requests, collections, all sorts of different things are macroable, which basically means you can add your own methods on there. So you can just fluently chain that particular custom method on. So then now the URI class is macroable similar to many of those others.

Jake:

That's it for 12 dot seven. You can, of course, find the change log between 12 dot six and twelve zero on GitHub. And those release notes are directly from the change log that we have in the show notes. Check those ones out.

Michael:

Automatic relation loading was a highlight feature, I think, from Laravel 12.8. Now this one has actually been simmering for quite a while, like months of time, I think. And the original person that submitted it put in a lot of work. Taylor then came in and, did tailor things to it. So this effectively allows you to, in large projects, it can become difficult to track and manually specify which relations should be eager loaded especially if those relations are deeply nested or dynamically used.

Michael:

Therefore, automatic relation loading can be useful quoting Sirhe Litvinchuk from his pull request adding the feature. So previously where you would have done something either like, you know, a project colon colon with and then passed an array of relationships or on an already loaded project, you might call project arrow load and then pass a list of relationships. And you can use dot notation to go you know, for a project, you can load the client.owner. Details, and it'll traverse the relationships of all of those models and make sure that it will efficiently load everything in one query. But as pointed out in the pull request, it can get a bit overwhelming to remember to to add them, to determine which ones are being used if you're not using the strict model stuff in Laravel to kind of prevent things from being used that you didn't mean to.

Michael:

Using this new with relationship auto loading method on a collection will handle doing all of that for you. So you can just reference things and Laravel will introspect those nested calls and will make sure that it will automatically eager load the missing relationships for you using the load missing method. You can also enable automatic loading across models using the automatically eager load relationships method on the model parent class. So thanks to Sohi for that one. Dark ghost hunter contributed a from JSON method to the collection class, which you can use to create a collection from a JSON string.

Michael:

If you've ever done this before, if you've ever pulled things in from a file that you've got in storage, for example, you know that you would have had to do a JSON decode on the JSON string and make sure it gets parsed as an array. You can now do collection colon colon from JSON to get the same outcome. Philip Yezzi contributed a force create many and force create many quietly eloquent method for the has one or many relationships. So previously, you would have had to map over them and then, run all of these things by hand. You can now pipe this through a collection of models and have that all done for you nice and simply.

Michael:

There are some code examples, of course. And I know at this point never to try and read them out if I can help it. So we'll have links to all of that for you in the show notes.

Jake:

Very good. Well, folks, this is a really exciting one. Simon Hamp and Marcel Pousiat have worked together to bring us native PHP for desktop version one dot o dot o. So this was started years ago, actually, at the, US twenty twenty three Nashville Lyricon, minds were blown when Marcel first demonstrated this framework that he was it's not framework. Right?

Jake:

But this library that he was using to build these cross platform desktop apps. So you have things like window management and menu management and file management and database support and native notifications and all those sorts of things. So you could build, like, you know, a menu bar app. You could build a launcher app. You could build a screen recorder.

Jake:

You can build all sorts of things that you could do directly in the operating system of your choice. And now also, you can do that for mobile apps as well. So there's two different talks out there actually about this, Lyricon twenty twenty three one from Marcel, of course, And then there's also the talk from Simon Hamp at Lyricon EU building mobile apps with PHP. So up until now, it's been in beta, but this has been a huge milestone for a project that started. It's just an idea to see it reach a stable release and support building different apps across all these these platforms is is pretty incredible.

Jake:

So 04/01/2023, when, shared on Twitter, I I think I don't know if it was shown as, like, a April fools sort of thing. But, you know, Taylor was like, yeah. Super interested. Aaron Francis. Yes, please.

Jake:

Let's definitely do this. And that was all the encouragement that was needed. So two years later and today, it's the best way for Laravel devs to build distributable desktop apps. So for those of you who have tried the alpha or the beta, all you need to do is update the dependency in your Composer JSON to the version one release and then run Composer update. You should see your Laravel app appear in its own window ready for you to start building something awesome.

Jake:

So this release of native PHP has dropped support for Laravel 10 and PHP eight one and eight two. So make sure your apps are up to date and ready to work with the latest tooling, and then go tell all your friends that native PHP is ready for the prime time. So check out the official release announcement on GitHub where they talk about all of this and look at all the neat new things that they're doing there as well as get some ideas for things that you could create with native PHP. Thanks so much for all the work on that one, Simon and Marcel, and all the folks around that project. Really great work.

Michael:

Yeah. Speaking of Marcel, Laravel heard the Raycast extension from the team at Beyond Code. This was released. If you've not used Raycast, it is a popular productivity application that you can use to replace the spotlight tool on a Mac computer. And the Laravel Heard's extension will allow you to quickly install new PHP versions to update your global PHP version, update the configuration files in your editor, and more.

Michael:

Along with all of that, you've got quick access to Heard features and settings allowing you to directly interact with Heard's functionality from the Raycast application. You can open sites in your code editor in browser or finder to get to those things wherever you need to. You can access Heard's dumps window. You have access to the built in Heard mail server, and you can open a site's environment file, database, and more. The Heard extension can be found on the Raycast website.

Michael:

The source code is available on GitHub. You will need to have Raycast installed to use the extension, which is only available for macOS at the current time. You can check out all of that. I I've you know, I saw when this post came out announcing the extension. I was very excited by it, and I just haven't installed it yet.

Michael:

So I'm gonna do it right now while Yeah.

Jake:

I did it. Picks up the next Yeah. I I did. I I put it up the first day, and it is definitely helpful. No doubt about it.

Jake:

And really good work on that one. I love Raycast. Raycast is so great. I use it

Michael:

It's good, isn't it?

Jake:

All the time. It's excellent. It has replaced so many other apps on my computer and huge fan. So it was really nice to have the Laravel herd extension drop.

Michael:

Yeah. And

Jake:

Hey. Speaking of awesome things and awesome people, Laravel's conference speaking and more with Zuzana Kay. So Eric sat down with Zuzana, who is an incredible individual. I had the opportunity to speak with her at LaraCon in 2023 at Nashville, so I got to spend some time with her. She's just an awesome person and been able to keep up with her.

Jake:

She's a really cool mom, I think, too. We talked about our kids, and her daughter is insanely talented at drawing and just really cool stuff. So really nice person. Eric got to sit down with her and talk about her power sorry, her career and how she's just explored this this power of community and tech and her journey in building Lara Bells, which is an initiative supporting women and anybody who doesn't identify as a man in Larabelle development. She shares her path into tech, the different challenges she's had, and why visible role models matter.

Jake:

So, really great episode. You should definitely check it out. Also, you can check out LaraBells.com or Zuzana-k.com or her personal website or her podcast, CheeseandWeather.com, where her and a couple other folks that you might know, Ben Holman, Dave Hicking, talk about, you know, all things related to cheese and weather, and there's been a couple guests on there as well. So it's good times. You definitely check that one out.

Jake:

And,

Michael:

shout out also to Suzanna who's just gone full time on, on Larabelle's to to really dedicate time and her effort into making that as good as it can be. She was on the overengineered podcast with Chris Morell, last week at the time of this recording, so I will link to that one in the show notes for you to check out, but shout out. I know it was, you know, when LaraCon AU started back in 2018, we had, like, Jess Archer. She was, you know, the the female member of the community, and it's just been inspiring. I think a lot on the back of the work Suzanne has done, on the work that the community at Elijah's done, and and having people in the community on stage representing, you know, the the lesser represented parts of the community to see that grow.

Michael:

You know, we had, 30 as 30 or so nonmale people that they all got on stage to take a photo last year at LaraCon AU, you know, which is a huge improvement. Still more work to be done, of course, but, you know, way more than that one Jess Archer back in 2018. And even just last year at in Dallas to seeing all of the people that were on stage for the photo there as well. So shout out, Zuzanna. You're doing incredible work, and we look forward to supporting that in the future as well.

Michael:

On the packages. First up, we have Jake has has kindly put a tutorial in here in the package section.

Jake:

Sorry. Sorry.

Michael:

Image image dimension validation with Laravel's dimensions rule. We'll talk about it anyway. Laravel offers

Jake:

That's a good

Michael:

one. Powerful image validation capabilities through the dimensions rule and provides fine grained control of your image size and proportions for your applications media uploads. So you can use the rule dotop dimensions method and then you can specify minimum width, minimum height, max width, max height on your images that are being uploaded that are going through, you know, the image validation rule. You can handle dimensions. You can handle aspect ratios and all kinds of things like that.

Michael:

The tutorial goes into more detail about that. We'll have links to that for you in the show notes.

Jake:

Very cool. Another package we have here is called Laravel Unique. This is a package by Will Vincent that allows you a trait for your Laravel Eloquent models that will ensure that a field remains unique within specified constraints. So you might say to yourself, why would I not just mark a field as unique in the database? Well, you can, but then you have to be the one responsible for figuring out what a unique name is.

Jake:

You have to do the, like, is it does it exist already or whatever? And you don't wanna necessarily throw a validation error or something like that. So this offers flexible suffix form suffix formats or custom value generators, which are ideal for scenarios like unique names, slugs, or identifiers. So here are some of the main features. It enforces uniqueness at the application level before saving.

Jake:

So before it hits that error, it will enforce uniqueness previous to that point. It supports custom suffix formats. It allows for custom value generators for advanced uniqueness logic. It's configurable via a config file or model properties, and it handles constraints like uniqueness within a specific scope. So you could say, it needs to be unique to this team, for example.

Jake:

So as long as it's not duplicated across the team, it should be fine. So all that sort of stuff. The examples are really helpful. I'm not gonna read through all the different ones that we have, but I think the description itself does a pretty good job explaining what it is it's trying to accomplish. So, again, just as a final note, the package ensures uniqueness at the application level, but for data integrity, particularly in high concurrency scenarios, if you're needing to do that, it would also be advisable to add database level unique constraints in conjunction with this trait, but this will help you avoid any problems you might have on that front by doing, you know, some of the unique checks for you.

Jake:

They're very unique.

Michael:

Nice. WISP is a PHPSSH server package created by Ashley Hindle. It is the simplest way to build PHPSSH apps and all and allows you to run your Laravel prompts apps through SSH with ridiculous simplicity. If you're starting a new application, you can use the existing project template provided by Ash or you can add Wisp to an existing project using Composer. You start the server and provide the apps you would like to be made available using, the Wisp server and specify a port.

Michael:

And then this also allows Wisp to auto discover apps or provide a single default application. You can test your applications locally by SSH into a local port, and your users will access your apps remotely, using SSH. We've seen a lot of examples of this. Joe Tanenbaum did a lot of stuff like this last year in terms of you know two e's over SSH The terminal team have a selling coffee were or were selling coffee exclusively in the terminal, so there's lot of this stuff going on in the world at the moment I don't I can't think of any practical use cases off the top of my head, but if it's something that you wanted to do, then it's certainly something that is readily available to PHP developers now. So definitely check that out.

Michael:

We have links to Whisp in the show notes.

Jake:

You know, I one of the things that I think could be helpful with this is if you had something that you wanted to do to dynamically retry jobs or things like that, you know, you could put something together where you have like a Forge API, something like that. But, you know, so you could be issuing commands to Forge, and that's fine. That does work. But you could also just sort of SSH in and pop around and do those things. But this would this would certainly be helpful instead of having to get into each one of the ones, you know, each one of the locations and go issue the retry commands and things like that.

Jake:

I could see something like that helping. We have a number of different applications that we monitor for failed jobs throughout the day. And I I could see something like this being helpful. I mean, really, just talking about saving time. Right?

Jake:

That's what it comes down to. Really, at the end of the day, one of the big things that we are employed to do as developers is to save time. That's why we exist, is to make things more efficient. And speaking of efficiency, if you are one of the people on the team tasked with reviewing code, you know that that can turn into a daunting task really quickly, especially if you've got a large number of team members and you are the one tasked with doing the reviews. So CodeRabbit actually makes that process a lot easier.

Jake:

Their claim in fact is that they can cut review time in half and while doing so, they can also monitor for bugs that might be found in your code automatically that you might not find when reviewing it manually. So if you've ever spent hours reviewing Laravel service provider implementation or catching circular dependencies and and or, you know, in your dependency injection, if you want your code reviews to catch architectural issues before they become technical debt, then CodeRabbit is your AI powered code review companion that deeply understands PHP, not just JavaScript. Right? So tired of all the JavaScript tools that aren't specific to us and what we want to deal with. So it deeply understands PHP, not only that, but the Laravel ecosystem going beyond what traditional analysis tools can catch.

Jake:

So it has automatic PR summaries, file change walkthroughs, it runs popular linters like PHP Stam, Stan, Biome, Rough. It has, highlighting for code and configuration security issues, and then it also enables you to write custom code, review instructions, and AST rep rules. They're proudly supporters of the PHP open source ecosystem and they're maintainers of products like Pinkery and Cache. Their commitment to open source means that they help maintainers focus on innovation rather than repetitive code reviews. Codebabbit is free for open source maintainers.

Jake:

So if you happen to be one of those, you should definitely be checking this out. Otherwise, can check them out at coderabbit.io. Thanks so much, coderabbit for sorry, coderabbit.ai, not io. Coderabbit A I. Thanks, coderabbit.

Michael:

PHP DevTools console is a package that we're gonna talk about here written, written up by Yannick. For years, front end developers have enjoyed the luxury of browser based developer tools to inspect, debug, and test their HTML, CSS, and JavaScript in real time. However, PHP developers, particularly those working with Laravel, haven't had the same convenience due to PHP's server side nature. This is about to change thanks to a new Chrome extension created by Tony Lee. This extension leverages Sparcy's Laravel web tinker package which requires developers to navigate a separate route to access its features.

Michael:

However, the new extension seamlessly integrates into your browser's DevTools panel. This means you can now access PHP and Laravel Artisan Tinker Console capabilities instantly without leaving your current page or switching between different windows. It is recommended of course that this is only used for development. You should never install it or use it in a production environment or any environment where you handle real world data. You can try this extension on your next development project by visiting the repository of GitHub and following installation instructions.

Michael:

We will have links to all of that for you in the show notes.

Jake:

Awesome. If you've not met JMAC before, mister Jason McCreery, mister Gondark, the shift creator, Laravel shift creator, you should definitely meet him. He's a lovely dude, and he had a mustache last time he was at LaraCon. It was amazing. It was glorious.

Jake:

He tried to convince me to do it. I couldn't I couldn't do it. But the Laravel test assertions package is created by this guy, by the shift creator, mister Chase McCree. It's a set of helpful assertions for testing Laravel applications, and the package provides a trait with useful assertions, Laravel matcher methods, and general test helpers. Here are some of them.

Jake:

Assert action uses form request. Assert action uses middleware. Assert route uses form request. Assert assert route uses middleware. Assert validation rules.

Jake:

Assert exact validation rules. Assert validation rule contains. Assert view has null. Create form request, all sorts of good stuff. And a lot of these things are just stuff that Jason is uniquely qualified to know about because he has seen the worst of the worst when it comes to Laravel applications.

Jake:

He's responsible for making sure that all of these applications are able to be shifted. And I know that, like, he has his human shift service as well. And one of the things he has to do is catch all of these crufty garbage errors. And so I know looking at some of these things, they've been custom made to help catch some of these these scenarios that aren't necessarily easy to test in Laravel. So those form request things or validation rules can be notoriously tricky.

Jake:

How do you how exactly do you test those? And so this kind of gives you a an opinionated way to test those things. So Jason shared an example of using this freeze now helper in a test to freeze time and make assertions. They also have some matches you can determine, you can use to determine if a variable is a model, a collection, or Eloquent collection instance. You can, of course, learn more about the package, get full installation instructions, and view the source code on GitHub where Jason has some helpful documentation in there and when you might use each one of these in particular.

Jake:

Check that one out. Thanks, Paul, for writing that one up. Everyone's favorite human.

Michael:

Nice. Once again this week, Harry Harris Rathopolis has been hard at work on tutorials. We've got what? One, two, three, four, five, six, seven, eight, nine, 10, 11, 12, 15. 15 different tutorials here.

Michael:

I know that you've singled out these three, Jake. Maybe you hit those, and then we will link to the other 13 in the show notes.

Jake:

Sounds good. I'll take the first two. You take the second two. Sound good?

Michael:

Sounds good.

Jake:

Okay. Simplifying real time notifications with Laravel's anonymous broadcasts. So Laravel introduced this idea of anonymous broadcast, which really provides a streamlined a streamlined approach to sending real time updates to your front end without having to create a dedicated event class. So sometimes, you know, you just wanna push it, set it and forget it, send it and forget it. So you could do broadcast Dodop on name of the channel arrow send.

Jake:

That's it. That's all you have to do to send a basic anonymous broadcast. So if you're wanting to just say something happened and you don't need an event class, just chuck it to the front end, and you're done. The simplified API enables quick implementation of real time features when you need these sort of ad hoc notifications without the formality of full event class structures. That's it.

Jake:

The system really offers lots of flexibility with different channel types to match your authentication requirements as well. You can control timing and recipient targeting with additional methods like send now or send only to me or send to others. And then it's really easy to listen to these events on the front end with echo. So check this all out if you're interested in that one. Monitoring HTTP interactions with Laravel's new HTTP record method.

Jake:

So this is cool. You can do HTTP fake. That's something that you can do with the new HTTP client, but you can also do HTTP record where you can make actual HTTP requests, and then you can access those recorded requests and responses for analysis. So unlike that HTTP fake, which prevents actual external communication, this method allows you visibility into real requests while letting them execute normally. Really invaluable for integration testing when you need to actually reach out and touch the real thing because debugging external API communications, can be difficult.

Jake:

So sometimes you need that. What what crest am I making? What response am I getting? And then allowing inspection without modification of those things. Really nice.

Michael:

Beautiful. Enhancing database error diagnostics with Laravel's GetRoy SQL. Debugging database errors in Laravel got easy with the GetRawSQL method available on the query exception class. The feature delivers complete SQL queries with all the bindings properly integrated eliminating guesswork when tracking down database issues. So you can catch your query exceptions and then call the get raw SQL, and then you might do something like log it.

Michael:

Obviously, when logging this stuff, be careful what kind of, PII, personal identifying information that might be in there, so use your best judgment on that. But Harris goes into some details around, handling how you would report, these exceptions in a useful way for you to deal with later. So check that one out. And the last one we have here is conditional context management made easy with Laravel's context facade. So context was added I think in Laravel 10 or Laravel 11 by Australia's very own Tim McDonald.

Michael:

This allows you to manage contextual data more eloquently with the context facade and it is now equipped with the conditionable trait. So this allows you to do things like con context when, context unless, etcetera etcetera, and then conditionally attach or detach or whatever you need to do. So the example that Harris has here is when you've got an authenticated user or when you've got an authenticated admin, might store more or less information based on that boolean lag. So check that one out. As I said, we had 15 tutorials written by Harris and the team this week, so we'll link to them all in the show notes for you to consume in your own leisure.

Michael:

But that is the end of the content for this episode.

Jake:

Show notes of this episode can be found at Laravel-news.com. Sorry. Podcast.Laravel-news.com/230five. You can find the show on YouTube as well streaming live. That's not true.

Jake:

You can only find the recorded versions. We don't do live streaming. We say too many dim dumb things. We gotta cut them out after the fact. If you have any questions or comments you'd like to chat with us online, hit us up on x or at bluesky@JacobBennettatMichaelDorinda or at Laravel News.

Jake:

And of course, if you liked the show, please rate it up in your pod catcher of choice. Five stars would be incredible. Leave us a review. We'd love to hear from you. Alright, folks.

Jake:

Till next time. We'll see you later and thanks CodeRabbit. Bye.

Creators and Guests

Michael Dyrynda
Host
Michael Dyrynda
Dad. @laravelphp Artisan. @LaraconAU organiser. Co-host of @northsouthaudio, @laravelnews, @ripplesfm. Opinions are mine.
Really eager loading, Larabelles, and whispy SSH servers
Broadcast by