Laravel 5.4 with Taylor Otwell
January 31, 2017

"Laravel 5.4 with Taylor Otwell" Full Transcript

This is the full transcript of the Laravel News podcast episode #30 - “Laravel 5.4 with Taylor Otwell

Jacob Bennett: Hey, everyone, welcome to [00:00:30] the inaugural episode of Michael and myself taking on the Laravel News podcast. In case you missed the last episode, Michael and I feel very privileged and very honored to be able to give back to the community in this way, which is by being passed the torch from Eric and Jack in taking over the Laravel News podcast. In honor of having our first episode, we figured what better way to kick it off than to have the creator of Laravel on the show with us. This morning, Taylor graciously woke up at 7:00 a.m. and is [00:01:00] on the podcast with us this morning. Taylor, welcome to the show.

Taylor Otwell: Hey, thanks for having me. Congrats on the new show.

Jacob Bennett: Thanks, yeah, this is a big deal for us. Michael, I mean, I have to give credit where credit is due. Michael is the one who is hustling, getting Eric to even consider this.

Taylor Otwell: Striking back room deals.

Jacob Bennett: Yeah, exactly.

Michael Dyrynda: International deals, that's what it is.

Jacob Bennett: Yeah, he all of a sudden messaged me on telegram one day and is like, "Hey, would you be interested in taking over Laravel News podcast?" Yes, yes, I would. How did [00:01:30] you do this?

Taylor Otwell: Oh, I thought he was going to send you one message that says, "We have the podcast."

Jacob Bennett: Yeah. It's pretty exciting, we're really excited. I would be, I think I posted on Twitter, I said, I would be lying if I said I wasn't nervous, because there's so much stuff to cover, especially this episode. Nothing like being thrown straight into the fire. I mean, we're talking over Laravel 5.4, and all of the features that have come to it, which there is just a ton. I was looking through the change log, and [00:02:00] it's like three pages. It's just huge. We're going to do our best to get through it all.

What are some of your favorite Laravel 5.4 features?

Jacob Bennett: Before we do that, though, we wanted to talk to you a little bit about some of the challenges or favorite features you had in 5.4, couple of things about adding new team members to the Laravel crew and how that's going. Let's just jump right into it. Obviously, you've been developing 5.4 for a while, since the middle of this summer. I know, if you had to pick your favorite feature from 5.3, if I had to guess, [00:02:30] I would probably say it's Echo. Is that accurate?

Taylor Otwell: Yeah, that's definitely accurate. I love Echo, with all my heart.

Jacob Bennett: Yeah. Passport has been pretty amazing, too. I know that, Michael, you were kind of having some woes trying to deal with that exact same situation, right?

Michael Dyrynda: Yeah.

Jacob Bennett: You're on 5.2 or 5.1?

Michael Dyrynda: We were on 5.1, so we didn't have the luxury of just installing Passport and getting on with our lives. We had to figure out how to retrofit that 5.3 goodness [00:03:00] into our 5.1 app. Which is now on 5.2, by the way, so we're moving up in the world. Jason McCreary's Laravel Shift made that so much easier for us

Taylor Otwell: Nice.

Jacob Bennett: It was really funny because it was literally like a list of, here are the challenges that Passport solves. Michael was on Twitter like, "How do I do this? If I'm trying to authenticate my front end to an API, how do I get a token to do this and whatever?" It was quite humorous. I was like, this has been solved in 5.3. Just do a couple of shifts.

Taylor Otwell: Yeah, I feel like Passport was definitely the user favorite, you know? I think it was more popular than Echo with, [00:03:30] as far as installs and actual usage, but it's definitely convenient if you're building oAuth [00:03:34] for sure, because that's a real pain to set up.

Jacob Bennett: Really, is Passport sort of like a precursor to, not a precursor, is it a prerequisite to Echo?

Taylor Otwell: No, they're sort of orthogonal, they're not really, you don't have to use one with the other, like that. Is that what you meant?

Jacob Bennett: Yeah, that's exactly what I meant. I didn't know if having to, I suppose they are handling different situations. I was just thinking like the frontend authenticating with the backend, but depending on how you have [00:04:00] your routes set up, it could make no difference, if you have Passport set up when you're using Echo.

Taylor Otwell: Yeah, sure.

Jacob Bennett: Yep, cool. Well, with that, with Echo being your favorite feature in 5.3, moving forward into 5.4, what's the thing that you're most excited about to see released and ready to go in Laravel 5.4?

Taylor Otwell: Honestly, the thing I was most happy about was not even really a user-facing feature. It was how I just thoroughly read through all the code and cleaned it all up internally. I feel like that just made [00:04:30] me sleep a lot better at night, because I sort of cleaned up the whole code base, found anything that looked confusing. A really good example is the paginate method in the database query builder. Internally it was kind of funky, because when you paginate something, at first we have to count. If you doing a "length aware" paginator, which is when you just call paginate, where we're going to show you that little slider of all the pages. If you're in the middle, it has the middle section of pages, [00:05:00] and like a "dot dot" in the last two pages when you show the links and that kind of thing, and "next" and "previous."

Jacob Bennett: Yep.

Taylor Otwell: To do that, to count all the results, we have to like, we can't have an "order by" in the query, so we have to slice that off the query. We can't have a few other things on the query, either. We manipulated the query, ran the count, and then sort of reconstructed it back. It was all just super confusing. So I cleaned that up a whole lot. Other parts of the framework that were confusing, I just tried to make more readable, because I felt like, if I was having trouble reading them, [00:05:30] then other people were definitely going to have trouble reading them, because I'm the one that originally wrote them, I mean, more or less.

Jacob Bennett: Right.

Taylor Otwell: I really am happy with how that turned out, because I think it just sets the framework in a good foundation for the next few years, because it had been a few years since I had done that. Stuff just accumulates through pull request and community contributions that are good, but they just sort of accumulate and things need to be organized a little bit to sort of account for all the changes that have happened. [00:06:00] I think this just sort of reset us on a good foundation of code quality in the framework itself.

Laravel Dusk

Taylor Otwell: Other than that, Dusk was fun to work on. I think it's going to be really good for apps that don't have any tests at all, and it would be very hard to refactor them to have like actual unit tests or feature tests, because they're just too big or too messy right now, and you don't really have time to refactor everything to make it easy. I think Dusk lets you at least put some sanity checks [00:06:30] around the app, where, okay, I can log in, I can do the basic functionalities of the app in the browser. It's okay for our customers to use this app or whatever.

Jacob Bennett: Right, right.

Taylor Otwell: I think it's sort of a supplemental testing tool that hopefully is going to be useful for people.

Jacob Bennett: Yeah, so for Dusk, that's what I was thinking about the other day is, I was trying to figure out, like you wouldn't do this unit [00:06:50] style, right? You're not going to write your test first with Dusk. I mean, you'd be changing it all the time, right? You kind of want to [00:07:00] get your UI, set up how you want, and then you're going to write the test, to prove that it's working as you want it. Whereas, like TDD, obviously you're going to write the unit [00:07:07] test, make it fail, and then write the code to pass. I feel like with the frontend, it's more design-y, right?

Taylor Otwell: Yeah.

Jacob Bennett: It's going to change a lot before you arrive at a spot where you say, like, okay, this is what I want it to do, this is how I want it to work. Then you at that point implement your Dusk tests.

Taylor Otwell: Yeah, I think so.

Jacob Bennett: Have you had much feedback with people, using 5.4, kind of the backwards break with, I guess that's what you'd [00:07:30] call it, right? I mean, I don't want it to sound bad to say like it breaks tests, but it's just the fact that you're using a different driver. You're not using Symphony's browser kit driver and not using Chrome's web driver or whatever it is.

Taylor Otwell: Yeah, I was pretty conscious of that when I put out 5.4. That's why I kind of extracted that browser kit into the browser kit testing package. I wanted to make sure that you can run all your 5.3 tests side by side with your new 5.4 tests. You can kind of make a slow migration, because [00:08:00] you can leave your 5.3 test in place, install the browser kit testing package, and maybe put all those tests in a separate folder. You don't have to, but that's just an idea so that you can kind of segregate them. Then you can install Dusk and use all the new 5.4 stuff entirely separately. You can run them side by side, and sort of slowly migrate tests over if you want to, or just leave them in place and write all new tests with, all your new tests in the 5.4 style.

I wanted to make that possible, because it really [00:08:30] wouldn't be that great to break everyone's tests with no option except to rewrite all the tests, so I wanted to definitely make sure you could run those side by side if you had to.

Michael Dyrynda: Yeah, no, I think just having that, it seems like there's a big push. It started with 5.3, and it seems to be continuing along now, where there's a big push to make Laravel to be as easy to test as possible, and to get as much coverage in that testing as possible. That's obviously been a conscious decision on your part, Taylor?

Taylor Otwell: Yeah, for sure. [00:09:00] I've tried to find a lot of the places that I didn't feel like were easy to test. There's still at least one that comes to mind that I would like to make easier in 5.5. Yeah, it started in 5.3, I think 5.3 had the introduction of the fakes, where you can say like "event fake, mail fake, notification fake," that kind of stuff. That was to make, that was kind of to simplify people's thought process around mocking where you're just faking and then asserting that certain things were called, [00:09:30] and it's simpler to implement than mocking for us under the hood.

Yeah, there's still a little bit going forward. Like one in 5.5 I'd like to solve is, if I have an email, say like a mailable object, it's a little tricky to test the HTML output of that email, to say like, okay, I built this email and I want to make sure it contains this link. Sort of like a Dusk-style test for your email is a little hard to pull off right now. It's possible, but it's not that great. I'd like to improve that for 5.5, [00:10:00] because that's really one of the only other kind of spots I can think of that's a little tricky to test right now, out of the box, as far as the core framework features. Hopefully, we can crack that for 5.5.

Jacob Bennett: I did notice that in I think even in 5.3 now, you have the ability to do like I think it's "mail fake," right? You do mail fake and then you can make assertions against who it was sent to and that sort of stuff. Previous to that, I was using "mailthief," which was kind of released for 5.2, [00:10:30] and in 5.3, I know there was a lot of discussion. I was talking to Adam, we had him on the show, our other show, and we're talking about ... You know, 5.3 had released, I said, "Our mailable class is going to break this testing tool that you've built." I think they found some work-arounds for it, I know Tighten Co. was working on doing some things, but in the newest app that I've been working on, I haven't even had to pull it in yet, because I've been able to do everything that I need to do with these "mail fake" tests.

Taylor Otwell: Yeah, and mail thief was the inspiration for mail fake. I had messaged Matt [00:11:00] at Tighten and said, "I really want to bring mail-thief style testing into the core, but I want to do it for events and jobs and the command bus and notifications as well." I actually did it on the plane over to Amsterdam actually, I think is when I wrote sort of the first iteration of that mail fake for mailables. Yeah, that was definitely an inspiration, because I thought mail thief was a really cool way to test email and definitely something that was a lot easier than what we had out of the box.

Jacob Bennett: Yeah, it seems to work really [00:11:30] well, and it was saving me from having to pull in one more package. Yeah, it works great. I wanted to go back to a couple of things real quickly here. You said you basically went through all of the code for the entire code base and just gave it a once-over and just kind of cleaned it all up. You had posted that blogpost, just kind of referencing when you had been working with your grandfather and cleaning off the underside of the lawnmower kind of thing. Consequently, before you had posted that, like the week before, I'd had seen some old guy in his driveway, like literally [00:12:00] had his lawnmower and had flipped it over sideways and spraying it. I was like, "What the heck is this dude doing? Because he's going to have to mow his lawn again next week." It was pretty funny.

Taylor Otwell: Yeah.

Jacob Bennett: It almost reminds me of, I'm not sure if you've read any of the Steve Jobs biographies or anything like that?

Taylor Otwell: Yeah, I have a little bit.

Jacob Bennett: Yeah, and how he talks about, I'm trying to remember if it was like a cabinet or something that they were making or whatever.

Michael Dyrynda: The insides of the drawers or something like that, yeah.

Jacob Bennett: Yeah, that's right, something like that, the insides of drawers. The attention to detail is important. Even when he was [00:12:30] building their first computers, he was so particular about the way the inside looked. He was even concerned about how the circuit boards were laid out, because he just didn't like the way that it looked, and so he made them change it or whatever. I just, I found that pretty, it was pretty similar, right? I kind of could draw the line between how Steve Jobs has said those sort of things or used that methodology and really what you were trying to accomplish there.

Taylor Otwell: Yeah, it's an interesting spectrum because on one hand, there are people that [00:13:00] need to pay more attention to detail in open source. On the other hand, there are people that are crippled by attention to detail, or paralyzed by "I can't release this because I don't feel like it's perfect yet." It's always like this razor-thin line to walk of getting things clean versus letting it just paralyze, sort of analysis paralysis, they call it, of just analyzing it forever.

Jacob Bennett: That's me, for sure.

Taylor Otwell: Once I got a file to the, even if I felt the first feeling of, okay, this looks okay, [00:13:30] like if that thought entered my brain the first time, I just closed the file. Because otherwise, I'm going to be stuck in it forever.

Jacob Bennett: Yeah, good point.

On Community Contributions

Michael Dyrynda: Awesome. Going on from, you mentioned a little bit earlier as well, having the community contributions, do you find that that tends to ... I mean, obviously, you were getting a lot of new features added to the framework, small ones and big ones. I mean, some of those contributions led to Laravel taking on its first full-time employee. Does this give you more time, [00:14:00] I guess, to focus on the bigger picture and more new features, or does it just end up giving you more things that you need to review and give a once-over?

Taylor Otwell: It's definitely a net positive, where I have more time. There are, the contributions have been picking up recently, and right around releases are always heavy for contributions. The nice thing about having Mohamed on board is, he can sort of really take the lead on Spark, he can really look at all the GitHub issues, whereas I don't really have time to browse [00:14:30] through all of them, and kind of triage and find, what issues might we want to focus on in the near term, or even what are the emergencies that we need to focus on? Him being able to get Spark ready for 5.4, make sure Lumen is ready for 5.4, all that other stuff, kind of lets me focus on the core, like the heart of Laravel really, instead of always being pulled ten different directions [00:15:00] with ... We have quite a few packages now, so it helps with that a lot.I can also, like if a pull request comes in that I don't really have time to like pull down and check it out and make sure it works okay, I can ask Mohamed, "Hey, can you check out this PR, make sure it does what it says on the label, or whatever, and works okay?" That saves me a lot of time really. I've had lots of time to work on the framework, and whatever else I want to work on recently.

I can also, like if a pull request comes in that I don't really have time to like pull down and check it out and make sure it works okay, I can ask Mohamed, "Hey, can you check out this PR, make sure it does what it says on the label, or whatever, and works okay?" That saves me a lot of time really. I've had lots of time to work on the framework, and whatever else I want to work on recently.

Jacob Bennett: Yeah, because this is the first [00:15:30] release that you've had full, like another full-time helper pretty much, right?

Taylor Otwell: Yeah, mm-hmm (affirmative), that's right.

Jacob Bennett: Yeah. You had talked about the fact that Laravel has a lot of packages. The one thing that I noticed is that you guys pulled out Tinker into its own, would you call it a package?

Taylor Otwell: Yeah, into its own package, yeah.

Jacob Bennett: Is that a Laravel, I mean, I know obviously PHP Artisan Tinker, whatever, we use that all the time. Is that built on top of something else that's in existence, or is that literally you built that from the ground up?

Taylor Otwell: No, it's built on top of the shell [00:16:00] called PsySH, I guess you would call it. P-S-Y-S-H. Yeah, that basically is the 99 percent of the whole experience, and then we added stuff for properly formatting eloquent models, for properly formatting the IOC container, if you dump it out. I don't even really remember the details of why that was made its own package. I mean, it's included in Laravel by default, like in the Laravel Laravel Repository, it's listed in the dependencies out of [00:16:30] the box, so it's still really there. I think there was some sort of PHP Parser, which is one of the dependencies is ... I don't know, Graham Campbell was in charge of making that a package, and it sort of helped us with dependency conflicts at the framework level, from what I remember. Anyway ...

Jacob Bennett: Okay. Yeah, that was what I was curious about, is I didn't know if there was a specific reason why it was pulled out into its own. It's one of my favorite things ever. I use it all the time.

Taylor Otwell: Yeah, Graham is sort of a composer wizard and knows, [00:17:00] he thought it was advantageous for us versioning-wise to pull that out into its own package. I'll have to ask him to refresh my memory of why.

Jacob Bennett: Yeah.

Laravel Horizon?

Michael Dyrynda: Speaking of packages, you've been teasing a little bit on Twitter the last week or two about this new project that you're working on, Horizon. Do you have any clues for us? Do you have a release target in mind? Is it going to be stand-alone or is it going for 5.5?

Taylor Otwell: Right now, I'm building it on top of 5.4, I haven't had to add anything [00:17:30] to the framework to make it possible. With Horizon, I can't really tease anything because I don't know if it will even materialize. Sometimes I go off on these big experiments that might last like a week or two, and they end up just getting trashed. The first version of Dusk, I think I've mentioned before, was built on Nightwatch.js, it wasn't even in PHP. I spend like two weeks building it in pure Javascript, and then was like, "This is kind of garbage." Just [00:18:00] had to trash it all.

The same thing could happen with Horizon. So far, I just take it kind of a day at a time. I haven't hit any roadblocks that would make it not possible, so I just kind of keep going. I'm targeting the summer, like Laracon. I would like to show it at Laracon, if it's done. If it's not done, I'll have to come up with something else, and hopefully something materializes.

Michael Dyrynda: I'm sure you will.

Jacob Bennett: Yeah, and speaking of Laracon, tickets just sold out yesterday, right?

Taylor Otwell: Yeah, which was crazy.

Jacob Bennett: That is crazy.

Taylor Otwell: Super [00:18:30] crazy. The fastest we've ever sold out. They've only been on sale for a couple of months, really, since December. It's going to be very crowded. I think I actually left ten empty seats, just so we have like up front at least a place to set the blogger, or any videographer or whatever. Other than that, like every seat will be filled in the whole theater.

Jacob Bennett: Wow, that's insane. I mean, what was the sell rate for like last year? Because, I mean, it was busy. I think you guys, did you sell [00:19:00] out?

Taylor Otwell: No, we didn't sell out, we sold 550 tickets, but that theater held 620, so there were actually 70 empty seats in the theater. This venue actually holds 500, so we're actually going to have 50 less people than 20, what is it, 2016, but it was just the right venue, just happened to not have quite as many seats, but still a pretty good time, I think, pretty good amount [00:19:30] of people.

Michael Dyrynda: It's New York.

Jacob Bennett: Yeah, exciting to have it back in New York. That will be pretty cool. The first I think, let me think, yeah, the first one I went to was in New York, and then two Louisville's, and then back to New York. That will be pretty cool.

Taylor Otwell: Yeah, for sure.

Michael Dyrynda: It's cool for everyone, except for those traveling from Australia who have to go to the other side of the United States.

Taylor Otwell: Yeah.

Jacob Bennett: We'll have a West Coast one eventually.

Michael Dyrynda: San Diego?

Taylor Otwell: Yeah, I looked into San Diego, I looked into it for this year, but it just didn't come together.

Jacob Bennett: Yeah, eventually, who knows? I mean, the weather in San Diego, I've only been over there one time, [00:20:00] but I always like to tell this experience, because it was so crazy to me. The hotel we stayed at, the entire front of it was just all glass and had these massive sliding doors. But they were never closed. These huge sliding doors were just never closed, because it was like it was climate-controlled outside. They never had to change the temperature. The temperature that it was outside was the temperature that you'd want it at all the time. It was amazing. It was pretty cool. Maybe we'll get over there eventually sometime.

I wanted to ask you I think one [00:20:30] of the last pieces we'll ask you real quick, and then we'll let you get on with your day and we'll dig into talking about the rest of the 5.4 details we haven't gotten to on here. You mentioned the paginate and how that kind of gave you some challenges. Was there anything, like any feature that you worked on for 5.4 that you can say, "This was my biggest challenge, or this was an interesting problem I ran into when we were dealing with this"?

Taylor Otwell: There wasn't, I mean, Dusk presented kind of a series of challenges, but none of them felt super-impossible [00:21:00] at the time. Overall it was a pretty straightforward release, actually. The last few days before the release, I didn't really do anything, because it was ready to go, which is unlike previous releases where really we were scrambling hard until the very day of release. No, I don't remember anything that was just really hard to crack.

You know, with Dusk, I wanted to make it real easy to install and get started out of the box. That was the sort of the biggest hurdle I wanted to get over, [00:21:30] where I could just install the package, run Artisan Dusk, and it just magically works. I don't have to install Selenium or go to the Java developer kit page and download a JDK or whatever the other tools typically make you do. I wanted to just pop open Chrome, start testing, and it works. Figuring all that out was probably was probably the biggest challenge overall because I had never really had a ton of experience with Selenium, and I just sort of had to dive in headfirst and figure [00:22:00] it out.

Jacob Bennett: When you're doing Dusk, it actually will open up your Chrome browser.

Taylor Otwell: Right.

Jacob Bennett: And/or multiple windows, like if you're doing the socket testing, which is so cool, by the way. That's incredible.

Taylor Otwell: Yeah.

Jacob Bennett: When I was, I was looking through some of the documentation for Dusk and getting it set up, and I was just trying to wrap my head around like, okay, how is it that ... Because is it using Selenium?

Taylor Otwell: Yes.

Jacob Bennett: It's just using a different driver, it's not using a ".JAR" file.

Taylor Otwell: Yeah, it's using like a Selenium-compatible stand-alone Chrome driver.

Jacob Bennett: I envisioned it as almost like a series of breakthroughs for [00:22:30] you. It must have been like, "Okay, this is how I want it to work, now I need to figure out how I can have that happen." There's like the Facebook PHP thing that interacts with Selenium or whatever, and then there's the whole Chrome driver sort of things, and then trying to get those all to wire together. I was like, man, it was a lot of work put into that, just trying to get it to work in a way that it was sane without having to do any other installations other than just pull a package in. It's really cool.

Taylor Otwell: Yeah, thanks.

Jacob Bennett: Yeah, absolutely. No, thank you. Yeah, we're really excited [00:23:00] to get 5.4 out, well, not get it out, but get it installed on my computer and put a project on there. Lots of fun stuff to work with. Michael, any parting words, my friend?

What drives you to work so hard?

Michael Dyrynda: Yeah, last one, Taylor. What really drives you to just keep working hard? I remember when 5.3 came out, you sort of made it seem like this was the pinnacle, and you couldn't possibly come up with something to top it, and now, going through the change like for 5.4, there is a lot, [00:23:30] there is a lot that has happened in 5.4, and you're already ready to crack on with 5.5. What just keeps you going all the time?

Taylor Otwell: I don't, like as I approach each release at the end of it, I always feel like, this is it, like I have no more ideas. This is sort of the end of improvements to Laravel. Then always somehow, just like something materializes, and I think this time, it just happened to materialize a little bit earlier than usual. Like with 5.3, I got 5.3 [00:24:00] out, and I don't really remember doing a lot for a while, like a few months until ... I know Adam had mentioned he wanted to be able to use the notification templates, but just for regular emails. He had bugged me about that for a while. He was the one that kind of spurred the markdown email and just using the notification components in the email thing, because that wasn't even one of my original ideas.

This time, with 5.4, I had [00:24:30] the whole Horizon idea in my head before 5.4 ever came out. I was just ready to hit the ground running, but after Horizon, I really am out of ideas again, like it's over again, so I'll have to start, I'll have to wait and just trust that something will show up.

Jacob Bennett: I remember that being one of the things I was really excited about that you talked about at Laracon in 2016 was the out-of-the-box responsive email templates that the notifications were going to use, which is really cool. Is [00:25:00] there any way, I guess that is a question is, because I really wanted just like the responsiveness, and the fact that it was going to deliver well and I didn't have to write some crazy email template. Is that what the whole purpose of using the markdown in email was? I mean, do you get some of that same stuff in ...

Taylor Otwell: Yeah, you get the exact same stuff.

Jacob Bennett: Do you? Okay, I wasn't aware of that. That's pretty cool.

Taylor Otwell: It's the exact same buttons and all that is shared between notifications and markdown email. What actually happens is in 5.4, when you send [00:25:30] a notification, it's using the markdown email under the hood. That's really the bottom layer, and notifications now sits on top of that. What's also nice is with the markdown email, you can export all of those components, like there's a button component, a panel component, and there's only a few, but stuff like that. You export them to your app, and you can customize those, and not only can you customize them, it also exports a CSS file, and when you edit that CSS file, Laravel takes [00:26:00] care through a package of inlining all of that CSS into the HTML for you.

Because you know, when you send emails, as you probably know, a lot of the styles have to be inlined and all that stuff. You can edit that one CSS file or even share a CSS file like a theme with other people and pull it in and it will inline it all for you. Yeah, that was sort of the goal behind markdown mail is being able to get all that responsive, easy to use stuff in all of your email, not just notifications.

Jacob Bennett: I didn't look into [00:26:30] that enough, because that may be my new favorite feature, by far.

Taylor Otwell: Yeah, you should sit and play with it, just do "make mail," and then do the dash-dash markdown and give it a view name and send one to like mail trap or something like that.

Jacob Bennett: Okay, I'm really excited about that right now. We're going to say good-bye on the show, and then me and Michael are going take a break, and I'm going to go mess with that and come back. That's incredible, I'm really excited about that. Thanks for doing that, that's pretty cool. I suppose it's interesting to, as you're talking about these features, it's interesting how many [00:27:00] of the features that 5.4 comes with are related to that. So like the whole components thing.

Taylor Otwell: Yeah, components and slots are what made that even possible, to even do markdown mail. Components and slots is such a crazy thing because like it wasn't even my idea. It was pull requested by someone, and they had it sort of halfway to what it is now, like they had the whole, they had components, but they didn't have name slots and stuff like that. I looked at their pull request, and it was like, this is very [00:27:30] similar to views, components and slots, and then it was just like the lightbulb went off, where it was like, oh, we could really do something cool with this, where we could have these reusable blade components. Now it feels like, I don't even know how we went so long without them, is how I feel now, because they're so nice for certain situations, especially like the markdown mail stuff.

Michael Dyrynda: Yeah, someone is going to have to register

Taylor Otwell: I know, yeah.

Jacob Bennett: It's like listening to a good comedian. When they say something funny, [00:28:00] it's like, oh, my word, that's hilarious, but I've never thought about that. It's a common, everyday occurrence and you're like, why haven't I ever thought about that? It makes so much sense that that's funny. It's the same thing with these components. Once you see it, it's so common sense, you're like, how did we live without that? How would I ever not have that now?

Taylor Otwell: I know, yeah.

Jacob Bennett: We talked about that on the previous Laravel News podcast, was that components is pretty cool. In a couple of videos that I'd watched, I guess my initial mindset was that these slots would be replacing kind of the variables that you had passed in almost as props to components, [00:28:30] but that's not necessarily the case. You can use them both in unison, right?

Taylor Otwell: Yeah.

Jacob Bennett: You have a component that you're pulling out of the page, and you can pass at some props. You're just like "comma," and then pass your little array of props essentially. Then you can have your name slots in there as well. Like you said, it's very much like View, feels very familiar.

Taylor Otwell: Mm-hmm (affirmative).

Jacob Bennett: Yeah, pretty cool. Well, Taylor, thank you so much for coming on this morning, taking some time out to talk with us. Super-excited to get our hands on 5.4, and thanks for all the work you put into it. This podcast [00:29:00] obviously would not exist without Laravel. Thanks a lot.

Taylor Otwell: All right. Thanks for having me. See you all later.

Jacob Bennett: All right, yep. Bye-bye.

Michael Dyrynda: Cheers, Taylor.

Laravel 5.4 Features

Jacob Bennett: All right the rest of the episode here, we have a long list of things that are coming in 5.4. Actually, they aren't coming in 5.4, they've been released with 5.4 that we're going to talk through. We are definitely not going to get through every feature that was released or the entire change log, it's just way too large. We've just picked a couple things to talk about here. Michael, you want to start us off by [00:29:30] giving us a friendly service announcement about an error that you might run into if you're coming from a previous version of Laravel?

Michael Dyrynda: Yeah, I had, this one came through that I bumped into it myself on Sunday night before 5.4 came out, as I was playing around with some packages. Basically, what this one is, is related to MySQL and Laravel 5.4 now switching to the utf8mb4 multibyte character set by default. It may affect applications that are [00:30:00] upgraded, if you're using multibyte strings, but it will definitely affect new applications unless you are running MySQL 5.7.7 or newer, or MariaDB 10.2.2, I think it was, from memory. Basically what this is is because we're now using multibyte strings which gives you support for non-standard, so unicode characters.

Jacob Bennett: Like emojis.

Michael Dyrynda: Like emojis, yeah, that's a big selling point. It basically takes up more of the keyspace, I believe. [00:30:30] Default character strings in older version, sorry, the default character strings for a VARCHAR is 255, so because of the multibyte string on earlier versions of MySQL and Maria, you need to change that value to 191. We'll link it up in the show notes how to address this issue, unless you're able to upgrade new versions of MySQL or MariaDB. There are configuration options you can use to then fix it up.

Jacob Bennett: [00:31:00] I'm wondering if it's because, okay, so if those, if it takes up more of the character space, if that's what you called it, each character is going to be more bytes, right?

Michael Dyrynda: Yeah.

Jacob Bennett: If by default it was, what was it before, 255 or something?

Michael Dyrynda: Yeah.

Jacob Bennett: Yeah, so if each character takes up a little more space, then I guess it would make sense that you would have to set the default string length to 191, a little bit less, right?

Michael Dyrynda: Yeah.

Jacob Bennett: Well, thanks for that. Yeah, that's helpful for any of you who are running into that error, coming from a previous install, or again, depending on what your [00:31:30] version of your database you're running is. Okay, another thing that Laravel 5.4 includes is two new middlewares. Eric put out a post about this last week, I think. The first one that he mentioned is the Trim middleware. If you enable that, it will take any input values that are coming through in your requests, and it will trim the

Eric put out a post about this last week. The first one that he mentioned is the Trim middleware. If you enable that, it will take any input values that are coming through in your requests, and it will trim the white space off of the beginning and the end. This is something that you may have had to do manually before, so it you were grabbing addresses or email addresses [00:32:00] or names or things like that, let's say for instance like an email address maybe, if they accidentally put a space at the beginning or put a space at the end, it may confuse your validator, and say, "Nope, this is not a valid email, because it's got an extra space on the end."

Instead of having to manually trim and then do your validation, you can put this Trim middleware onto the route that you need to use it on, or include it on your global middlewares, and it will trim all of the inputs that come through. In that same vein, there is a, I don't know if it's a nullable, I'm trying [00:32:30] to remember what it's called here, let me look. This is a trim strings middleware and then there is "convert empty strings to null." Now, Michael, I know this hits close to home for you. This is actually how you and I first met, is you made a package called the nullable fields package, which does essentially this.

Michael Dyrynda: Yeah.

Jacob Bennett: Where on the model, you specified, these are the fields that are nullable, and when it comes through, it will basically check to see, are these fields blanks strings? If they are, convert them to null. This does it in a middleware. Is this [00:33:00] the nullable fields package killer?

Michael Dyrynda: I don't know. I updated to make sure that the package I had was compatible, so it's still there, for anyone that wants to use it. I think this is happening higher up the stack.

Jacob Bennett: Yes, yeah, it's happening at the request level instead at the creation of a model level.

Michael Dyrynda: Yeah. There's probably still value in basically taking those, because the empty strings will still come in to the request, so this is just a matter of taking those empty strings and then switching them to null, I guess, when you're [00:33:30] saving them.

Jacob Bennett: Yeah, so just to make sure we're not causing confusion here. The middleware will take the request and before you even get the request, it will convert anything that is a blank string to a null value. Michael's, what his does is it will basically at the point that you are saving your model, so it looks for the saving event and it looks through all of the attributes that are being passed to the model and it will nullify them if they're blank strings and you've set it in your nullible fields on [00:34:00] the model.

There's that. Anyway, these look like they're going to be really extremely helpful. Takes the manual portion out of trimming and making these strings null, which is pretty handy. Thanks for that, guys.

Michael Dyrynda: All right, so the next feature may prove to be slightly controversial in the greater PHP community, and that is automatic facades. We all know and love facades, basically allowing us to access class names by a static interface. [00:34:30] It's basically doing a new in the background and then giving you basically static access to those public methods. They're more proxies than anything else. In Laravel 5.4, there's a new feature that essentially allows you to take any class and access it via a façade using some clever reflection of the class itself, and then figuring out that you want to wrap that up in a façade and use it statically. [00:35:00] It's a pretty clever way of doing it. I had a bit of a poke [00:35:03] with a code yesterday. I don't know how often it would get used, but for the cases that it does, and it will certainly short-cut, if you're doing inline things where you're basically doing a new and then calling a single method on it straightaway, this will certainly come in handy there.

Jacob Bennett: Yeah.

Michael Dyrynda: One example that I came across was using the parsedown library to convert markdown [00:35:23] into HTML. This made that really easy.

Jacob Bennett: Right, and it's interesting how you said that, basically, [00:35:30] that this would replace something where you were newing up a class and then just pulling a method right off the end of that. I probably would tend to do that, though, instead of this automatic façade stuff. That's just me. Adam is going to hate my guts, right? I don't know. I'm sure if I was to talk to the guys who were responsible for that pull request and pulling that in, they would probably be able to give me good reasons for why it'd be better to use it that way. To me I guess I would probably feel more comfortable just using the new and then pulling the method [00:35:59] off the end there. [00:36:00] But that's just me. Anyway, it's a cool feature in any case. The only thing that would be handy is if it allowed me to make façade assertions in my tests, if I was using it as a façade in the controller. If I had a class that I wanted to make a quick assertion against, right? If you use "mail colon colon send," in your test, you can say "mail should receive send," and it just mocks that mail class. If that would do that for me in my test, [00:36:30] I might actually use it more often. If in my controller I had something, just some class that I wanted to make an assertion against, and if I used this automatic façade thing, if in my test I could say, "My custom class should receive 'build' once," I would definitely use it more often.

Michael Dyrynda: Yeah.

Jacob Bennett: Maybe it will. I'm not sure. We probably need to do a little bit more checking into that, and we'll get back to you on if that's how that works, next episode. Okay, another piece that we have that is a pretty large change is that Laravel Elixir will be renamed to Laravel Mix. [00:37:00] The big change that's happening there is that previously it was using Gulp and Browserify and things like that, and now it's basically been completely rewritten to use Webpack. I've done a little bit of reading on this this week. I'm still sort of fuzzy as to what the big, huge differences are between Gulp and Webpack. Basically, what I understand is that they're both task runners, but that Webpack can bundle [00:37:30] using common js syntax, and Gulp has to rely on Browserify or other Gulp plug-ins in order to be able to do that, right? Webpack can just use straight NPM scripts. Does that make sense? Help me out here.

Michael Dyrynda: Yeah, I think that's roughly what it is. I note that the documentation for installing Mix explicitly says that you need to use NPM.

Jacob Bennett: You can't use Yarn, right.

Michael Dyrynda: I found, yeah, I found that when I was playing around with it, if you use Yarn to install [00:38:00] your dependencies with Mix, it just doesn't work. I think I saw somewhere Jeffrey tweeted that there was some bug within Webpack that was being addressed, or Yarn I think, that was being addressed for that.

Jacob Bennett: Yeah, I think it was Yarn, had some thing to do with the binaries, or where it puts binaries when you're installing node modules.

Michael Dyrynda: Yeah, so be cautious of that. Make sure that you are using NPM. Unfortunately, you're going to have to slip back to using NPM to install for the time being.

Jacob Bennett: Yeah, that's a bummer, but ...

Michael Dyrynda: Just also going back [00:38:30] to the automatic facades, I was just having a look at Taylor's announcement tweet. It will work for classes that have constructors, but you will need to bind them into the container for that to work properly.

Jacob Bennett: Got it, yep, that makes sense. Next thing we wanted to talk about was using markdown for your emails. We talked about this with Taylor a little bit here. In 5.3, we were introduced to notifications, which my favorite thing about those is that they gave you a responsive template for emails right out of the box, which is pretty incredible. As [00:39:00] Taylor had mentioned, Adam had been bothering him to be able to use those in mailables. In 5.4, we have that. In your mailable, you just call this markdown and then pass in the blade templates that you would use, so like "emails.thanks," and then it assumes ".blade.php" on the end. Then you can just write your markdown in there, and you can include any of the components that they've written that work for notifications as well, like there's button, there's footer, there's header, there's layout, there's a bunch of different ones. [00:39:30] There's a post out here on Laravel News that explains all of it and has a couple really good examples. Another piece which was really interesting is the ability to use tables, which is awesome.

Michael Dyrynda: Yeah.

Jacob Bennett: Have you seen that?

Michael Dyrynda: Yeah.

Jacob Bennett: Yeah, if you've never written tables in markdown before, it's an interesting experience, but you can use them in your email really easily here, which is really cool. It's one of the components that's included that they're using for these markdown emails. Check that out. If you haven't looked at that yet, I'm looking at it right now. Really excited to give it a try. [00:40:00] That's another cool thing. Might be my favorite 5.4 feature. In addition to these components and stuff because really, those are used pretty heavily in here. That's awesome.

Michael Dyrynda: Yeah, for sure. As part of the Laravel 5.4, we've also got two new reasonably significant improvements that are coming to routing. The first one is route caching. There's been a bit of an overhaul behind the scenes which will allow matching on large applications, and so just helps speed [00:40:30] up matching of those applications as you're going through different routes there. In the context of these fixes, we're talking something that's a thousand or more routes. Previously the route caching would be fine until you reached about a thousand routes, and then it started to slow down a bit. These improvements will help you out if you're booting applications of that size. The other improvement that we've got it fluent registration of routes. We had this in Laravel 5.3, Jake, yeah?

Jacob Bennett: Yeah, [00:41:00] I think so, where you could append onto the end. Previously what it would be is, you would have to specify in an array when you were calling your route. You'd say "route colon colon get," and then the first thing you'd pass in would be an array. You'd have like middleware or prefix or whatever, or if you were using a route group, that's how you'd have to do it. This makes it a little bit easier. In 5.3, you could put on the end "arrow middleware," or "arrow prefix," and do it that way, but 5.4 handles it a little bit differently.

Michael Dyrynda: Yeah, so with 5.3, you had to add these different method names [00:41:30] in a specific order, so you had to start with the "get." With 5.4, you can basically put these in any order, I believe, so that makes declaring them a little bit easier.

Jacob Bennett: Yeah, if you wanted to have the name of the route that you were giving at the beginning, you could do that now. Instead of having to say "route get" or "route post" or "route patch" or whatever, you can say "route name," and then give it the name, and then after that, do your "arrow get," "arrow post," arrow whatever. Pretty cool, that you can really just pass it in any [00:42:00] way you want, which is why they call it fluent, fluent syntax, right?

Michael Dyrynda: Absolutely.

Jacob Bennett: Pretty cool. As a kind of a, going back to that route caching, you'd want to make sure that you are using that as a build step, right?

Michael Dyrynda: Yep.

Jacob Bennett: When you're deploying, if you're using something like Envoyer, you can use that as like a deployment hook. You can say, after the release has been created but before it gets activated, do a new route cache on that and that should update your routes, just to make sure you're not getting any old routes there. Just [00:42:30] something to be aware of, you'd want to handle that in production.

We also have JSON-based language files, which if you've ever tried to do internationalization of a site, this can be sort of a pain. Now Laravel has handled it in a very sane way in the past, where you essentially would have these language files, and I think you would just do "en.php." They were almost to remind you of what a config might look like. In your "en.php," you would specify a key at the beginning where you would say something like, [00:43:00] "welcome text." Then after that you would have what the actual welcome text would equal.

Then if you were translating it to Japanese, you'd have a "jp.php." It would include the same array, you would have the same keys that you were using, but obviously the translation on the other side would be different. You can imagine as you're looking through, if there's an entire site that's been internationalized, what you end up having is a bunch of spots where text would normally be, where it just says "translate" and then it just [00:43:30] has a key "welcome text."

That can be kind of challenging because you can't see what's actually being said there, right? We have in Laravel 5.4, they switched this out to be instead of arrays, you can have these JSON-based language files. In a previous version, you'd says "trans" and then you'd give the keys that you would use to reference that translation, but in this, now you can just say basically, I think it's "underscore underscore" and then "paren," [00:44:00] and then you pass through the text that you would use.

If my welcome text was "thanks for checking out my site, let me know if you have any feedback," whatever, that would end up being the key for your translation. It's a little bit difficult to explain without being able to show you code right in front of your face. There is a post out there, if this is something that you're having to use on your website, it would definitely be worth [00:44:30] giving a check. Mohamed, I think, did a lot of work on this, so thanks, Mohamed. We have a site that we work on at the place where I work on Fridays, and they have to use the translation stuff extensively in Laravel. I'm going to be passing this along and giving it to them, and I think it would be pretty darn useful.

Michael Dyrynda: Yeah, there's a lot of people all across the world using Laravel, so there is a big market for people that need the ability to translate it and making it easier, which is [00:45:00] a common occurrence with Laravel is making things easier for developers. This should be a welcome change to those folks.

Jacob Bennett: Absolutely. It's really like one of those things where you going to have to look at it to [crosstalk 00:45:10] to know, it's really kind of difficult to explain without having it in front of you to see it.

Michael Dyrynda: It makes sense the second you look at it, but ...

Jacob Bennett: Yeah, and it's I think for me, like the biggest plus on it, is it literally just, it's going to be way easier to read. When you're looking at, you just see exactly what it [00:45:30] is that you're trying to say. And you just do "underscore underscore paren," and then pass in the key. It looks a lot better. Okay, components and slots. We've talked about that a little bit. Michael, you've been using them recently. Tell me what your experience has been like.

Michael Dyrynda: I love them. I think they're fantastic. As Taylor noted, they're basically a port [00:45:49] in from what we have in View, and the way that components and slots are structured there. Basically, you can define I guess a skeleton for what a [00:46:00] piece of your page would look like. You might have a panel, so you'd have a panel component and that would have a slot for the heading, a slot for the body. Then within your main template you could basically include the component and pass in either as an array into the component, keyed by the variable, the slot names, or you can actually name the slots within that code that is making the call.

Then of course, you've got the default slot, which you can, would place in the body of your [00:46:30] panel component, for example. I've actually be using them quite a bit on my own site in the last few days and once you figure out when you should and shouldn't use them, I think they're fantastic. I can see myself using them in the future, a lot.

Jacob Bennett: You're not going to hurt yourself if you overuse them either, really.

Michael Dyrynda: Not at all.

Jacob Bennett: I mean, it's not like you're going to get, it's not going to damage anything if you use them and you're like, "oh, should I use it here or not?" If you want to use it, just use it. It's going to be totally fine.

Michael Dyrynda: All of your blade files are going to be compiled down [00:47:00] anyway. It's not like you're going to take a performance hit for doing it this way.

Jacob Bennett: Right, it's more like a mental model thing, right? If it makes more sense for you to use them as components, then go for it, and it's going to, yeah, it's not going to hurt you at all. It's pretty cool. Really excited about using those. Another thing I'm really excited about is higher order messaging for collections. I'm going to, instead of trying to come up with an example that's better than Eric's, because Eric's is really good, I'm kind of just going to use his. If you're going through and you have a, [00:47:30] let's say you go to your database and you grab all the employees. You want to reject any employees that are retired, and then once you've got all those employees that are retired out of your list, you want to send a payment to all of those employees that are left.

What you would have had to previously is you'd have to say "employees," and then on that collection, you'd call a reject method. Into that reject method, you'd have to pass an anonymous function, would [00:47:54] accept an employee as an argument and then inside there, you would say, "return employee," [00:48:00] and then on that object you would have a retired method, or a retired property, either way, one or the other. It really does work for both. Imagine that's the case. You have a retired property on your employee, you need to go through, in any of them, where retired is true, you need to reject those.

What you would have done is you would have said, "employees reject" on that, whatever we just talked about. Now what you have the option of doing is you just say, "employees" and instead of having to say "reject" and then pass that closure, and then do that retired, [00:48:30] you can just say "employees," "arrow reject," "arrow retired." It will accept that employee that it would have taken as an argument, and allow you to call methods on that straight in the collection. Then the same thing if like after you have all those rejected, the next thing you'd do is you would say "each," you pass a closure or an anonymous function, whatever, it accepts an employee, and then on that employee for each one of those, you would call the "send payment" method.

Instead of having to do that, again, you can just say "each," "arrow," [00:49:00] "send payment." Instead of having to pass through that closure and then pass in the value and then call a method on that object, you can just straight inline those calls, which makes it incredibly clean and very easy to read. I can see how this would trip up some people who haven't seen it before. If you had some junior devs on your team or people who were not aware of this new feature in 5.4, and they were just looking at it, I could see how this might be a little bit confusing for them. [00:49:30] After you've got your head around it and used it a couple times, I think you'll find it incredibly useful and it will make your code look very pretty. I think Fariq has something to do with that, didn't he?

Michael Dyrynda: No.

Jacob Bennett: No?

Michael Dyrynda: I normally like pronouncing [00:49:43] names, but this one is going to trip me up, I'm sure. I apologize in advance, but it's I guess Franz Liedke.

Jacob Bennett: Nice, there you go.

Michael Dyrynda: Yeah, he put in the pull request a little while ago to get the functionality [00:50:00] pulled in, and here we are. Obviously, it's come in so, yeah, as you say, it will probably trip up people who aren't too familiar with collections. I think it's a logical step for those who are already using collections in their code, which is, I think, fairly common within Laravel, but for anyone new to the framework or new to that style of development, they'll have to sit down and learn collections. I'd advise them to learn how their collections work first.

Jacob Bennett: [00:50:30] Yeah, that's good advice, yep.

Michael Dyrynda: Also, it's important to note that it's only a handful of methods that this works on as well, it's not the entire bag of collection methods, so there's I think filter, reject, each, map, sum, sortBy, and sortyBy descending. Things to keep in mind.

Jacob Bennett: Yep, it's limited to those, yep, good point, good point. I would agree, Michael, that if you don't know collections very well, feel free to pick up Adam Wathan's book, Refactoring to Collections. It's a great [00:51:00] introduction to collections. Goes literally from knowing nothing all the way to using them for practically everything, which is what I do these days. Yeah, check those out, great to use. Laravel Dusk is next. Michael, talk to us about that.

Michael Dyrynda: Yeah, so we talked a bit about this with Taylor a little bit earlier, so we probably won't go into too much detail, but definitely check out the blog post on the site for this. It's essentially a nicer way to write end-to-end tests within Laravel. [00:51:30] Previously Laravel used Symphony's browser kit to simulate basically being a user, clicking through the site, filling out forms, and submitting them. It didn't work with Javascript rendered on the page. Because it didn't have the ability to wait [00:51:46] because it wasn't rendering the actual page, it was simulating the render of the page.

Now that the frontend is starting to become more popular and a lot of people are starting to use things like View and React and whatever else, for you to be able to test those components we [00:52:00] basically went back to opening the browser, clicking, clicking, filling out forms, making sure everything worked, whilst we were doing a nice TTD flow for our backend.

Dusk helps to close that gap, obviously making the whole end-to-end browser testing process much more, I guess, Laravel-like, in that it's expressive methods, it's easy to follow, it makes sense to write those tests like that. As we said earlier on, it's probably going to be something that you do once you finalize [00:52:30] what your UI looks like.

Jacob Bennett: Yeah, I agree. One of the things that's really nice that we talked about and touched on just briefly is the ability to test that your events that are getting broadcast and either sent to Echo or that you're manually handling with Pusher, so as a for instance, we've created an application here where, let's say that there's, actually, we're on To Do List, right now, you and I, this is a good example.

Michael is looking at the page, I'm looking at the page, and when he clicks "check" for "we've talked about that thing," [00:53:00] it automatically updates on my side that it was checked.

You can imagine, the only way that you would really be able to test that would be to open up two browser windows and to go ahead and in the one, check something, and then in the other one, check to make sure, and check is a bad word here, assert that the other window also had that same checkbox, that it received the message and that it handled it. That was one of those things that was really difficult. How do you ever test that, right?

Laravel Dusk has solved that, Laravel [00:53:30] Dusk allows you to open up multiple browsers and then make assertions against each one. You can say, "In browser window one, check this checkbox. In browser window two, assert that that checkbox was also checked." It's pretty interesting. Solved some problems that I had given up on, that there was ever going to be an automated way to do that. Yeah, very cool.

Michael Dyrynda: Leading on from that, we're doing this spotlight on cool projects and cool things that folks are doing out there in the Laravel community. [00:54:00] Leading on from Dusk, as I mentioned, was this project that came out of nowhere from Jordan Dalton. What he'd basically done was use Laravel Dusk to set up a tool or a script that basically automatically will make monthly payments.

Jacob Bennett: For his utility bill

Michael Dyrynda: Yeah, that's right, for his utility bill. I don't think this is something that Taylor would have thought about when he was building Dusk. Everything that anyone has ever built ever has always found [00:54:30] a purpose other than what it was intended for, right?

Jacob Bennett: Yeah.

Michael Dyrynda: I mean, I wanted to talk about corn flakes, but I don't think we can talk about corn flakes. If you know the history of corn flakes, you will know that corn flakes was not originally, it was not created as a breakfast cereal. We'll leave that up to you if you want to look that up. Jordan has basically used the ...

Jacob Bennett: I did not know that.

Michael Dyrynda: What was that, sorry?

Jacob Bennett: I didn't know that, I did not know that piece of trivia.

Michael Dyrynda: Okay, you look it up. Jordan uses Automator on Mac OS, and an [00:55:00] Apple script with his Mac calendar app, and basically, very simply, like it's one class on the PHP side, and that will log into his utility provider, it will go to a certain page, it will go and make sure that he's got the correct address. He tries to make a payment with his credit card details, and then he gets basically a screen shot of the payment page. All of this ...

Jacob Bennett: So cool.

Michael Dyrynda: Is like 15 lines of code with Laravel [00:55:30] Dusk. You can use it to test your applications, you can use it to pay your utility bills. Look, congratulations to you, Jordan, that's a little bit of ingenuity. It's just some incredible things that people do out there in the Laravel community.

Jacob Bennett: Yeah, that's pretty cool, where they didn't have an API or they didn't have the ability to make a monthly payment for his utilities, he just made one. Which, now that I'm thinking about it, I'm like, man, I'm going to do that. I have a couple of sites where they don't have monthly, you can't do autopay, [00:56:00] like the town that we live in, the town of Normal. Yes, Normal. To pay your utility bill, like your water bill or whatever, they don't have a way to say, yeah, pay for this monthly. I might do that. I might take a page from Jordan's book and go ahead and modify his scripts to handle my stuff. Pretty cool. Paying utility bills as service. I mean, have we come to this?

Michael Dyrynda: Yeah.

Jacob Bennett: This is craziness. These people just need to allow us to pay monthly. Well, I think we are out of talking points [00:56:30] for 5.4. There is believe me a ton more that we could talk about, but I think this is going to hit the high points. Of course, thank you to Eric Barnes for all of the amazing work he does to put blog posts out there for these, to support our ramblings on this show. We will link all of these up in the show notes. For almost everything we've talked about here, Eric has a great post on Laravel News, explaining it in more detail and giving you code samples. I would highly suggest that you take a look at those show notes, click through and take a little bit of time to read those [00:57:00] blogposts.

Michael Dyrynda: Yeah, and we'll link up the change log as well. There is well over a hundred commits that have gone into just the 5.4.0 release, and there's already been six patch releases since launch, what, four days ago, so yeah, it's nice to know that active development continues.

Jacob Bennett: Absolutely. All right, well, thank you everyone, for listening to Michael and I's first Laravel News podcast. The show notes for this episode will be at [00:57:30] If you have any feedback you'd like to give, you can hit us up on Twitter @laravelnews. We look forward to getting some of your questions and being able to answer those on the next episode. Michael, it's always a great time talking to you.

Michael Dyrynda: Thanks, Jake.

Jacob Bennett: Thanks so much, yep, bye-bye.

Michael Dyrynda: [00:58:00] See you.

Speaker 5: You have to refer to me as Mr. Barnes. Mr. Barnes.

Jacob Bennett: Mr. Barnes.

Laravel News Partners


Join the weekly newsletter and never miss out on new tips, tutorials, and more.