Scott Keck-Warren
0:04
Hello developers, and welcome to the PHP Architect Community Corner, where we have conversations with members of the web development community. I'm your host, Scott Keckhorn, and today we're talking with Ashley Allen about how he got into PHP, his recent article in PHP Architect magazine, and his contributions to open source. Ash Allen is a freelance Laravel web developer, open source contributor, and the author of Battle Ready Laravel and Consuming APIs in Laravel. He can be found on Twitter @ashallandesign. Thank you, Ash, for finding some time to talk to me today.
Scott Keck-Warren
0:37
So I always like to start out and ask like how people got into the PHP community essentially.
Yeah, it's a good question. That, uh, for me it was when I went to university, we, we kind of tried out lots of different languages and stuff like that as we're going through the different years. Like we did a bit of Java, a bit of C++, a bit of C#. They didn't really jump out at me. I didn't really enjoy using them. And then we did, we built some little small applications with PHP and just something about it, I just, I really liked it. So when it came towards the end of me leaving university, I need to go and find a job. So a recruiter reached out to me in a place that I was looking to move to and they said there's a PHP and Laravel job coming up.
So I kind of fell into it because I wanted, I got the job where I wanted to move to really. Um, I mean, they were a fantastic company to work for as well at the time. Um, and yeah, I just, I just started using PHP and Laravel mainly because of that, and then just kind of fell in love with it. So I've not really used anything else since.
Scott Keck-Warren
1:39
Yeah, that's really cool. Like, I, um, I kind of had the same trajectory. Like, we— I was working somewhere and they're like, hey, we have a new project, or we want you on this project and it's using PHP. And I was like, oh, I gotta learn— I learned PHP, and then I've been Hooked ever since. So the reason that we had you on today was to talk about you, the article that you just wrote about serialization in PHP for the June 2024 issue of PHP Architect. Can, can you talk to us like a little bit about what serialization is in PHP?
Yeah. I mean, I don't want to give anything too much away, like read the article, but yeah, I think the best way to describe serialization is converting data into text, into a string that can be passed around everywhere and stuff like that. And it's something that I wanted to write about because I feel like it's something that when you first see it, you're like, what is that? And it'll really throw you off if you don't know what you're looking for. But then once you take a step back and you look at the different steps that are going on to serialize stuff in PHP, you realize it's not actually that complicated and there are just a lot of patterns going on there. once you kind of split things onto new lines, like make it a bit prettier to look at, you realize that actually it's not that hard. So I wanted to write that article just to give a breakdown of what's actually being done. How would you read it? Not that you really ever would, but there are a few times when I've needed to debug Laravel applications where we serialize objects and stuff like that when we're pushing them onto the queue. in Laravel. And sometimes you might need to investigate why a certain job isn't working the way it is working after it's been pulled off the queue and it's been run. So being able to know what to look for in the serialized string, really helpful. So it's, it's almost like an introduction to that style of, uh, transmitting data around and stuff like that.
Scott Keck-Warren
3:32
I always find it interesting, like the, the different levels of article that exist within our, our magazine, especially since like this is a, a I'm going to put it in air quotes, basic concept, right? Like taking an object and converting into a string and then back again is like a basic thing that happens like whether we know it or not every day in some of our applications. But like, especially me, I don't really like directly do that, right? It's always something that especially Laravel takes care of for us. And so it was really nice like reading your article and having, because I've done it before, it was nice having like a refresher and then remembering that there's those magic methods that that like have that extra little bit of control over, well, if you're bringing this back in, how do you handle that? So
Scott Keck-Warren
4:14
it was, I thought it was a really nice article to read about those things. Oh, thank you. Yeah. I highly recommend that anybody who has access to the magazine read the article because it is very helpful if you are trying to serialize. Even if you're not doing it right now, it might be something that you use in the future. We'll be back after this word from our sponsors. Do you want higher clarity in production but don't have the time to earn your degree in observability? Me too. Forget logs, metrics, and traces. Honeybadger Insights is built around structured events. When you send your application logs and other events to Honeybadger, you'll unlock the power of Honeybadger's powerful new querying language, BadgerQL. You can then use BadgerQL to ask any question about your data, convert any event into a metric, and chart your metrics on a custom dashboard. You can do all of this on Honeybadger's free plan as part of their comprehensive monitoring suite, which includes error tracking, uptime monitoring, status pages, and more. Speaking of error tracking, did you know that an error is really just a first-class event in Honey Badger? In fact, you can use Insights and BadgerQL to explore all of your existing Honey Badger data in new ways. It's pretty cool. Give it a try today at honeybadger.io. That's honeybadger.io. And we're back with Ash. So one of the things that I was— I noticed while I was looking through all of the various things that you're involved in is you have this website, findapr.io. Can you tell us a little bit about what the purpose of that is?
Yeah, of course. So Find a PR is a website that it helps you to find your very first PR, your very first pull request that you want to make to an open source project. So what it does is it lists out, it crawls through the GitHub API to find Laravel and PHP repos that have got open issues that have got certain tags against them, like help wanted, good first issue, stuff like that. Then what it does is it lists them so you can go in and say, oh, this repository needs some help, the maintainer is looking for someone to give them an extra hand. So you can go in and then you can make a PR to fix the bug, add a feature, whatever it is you need to do. And I made it because I attribute a lot of where I've got to so far in my career to open source, whether or not if it's been contributing to someone else's repositories or building my own. Mm-hmm. And when I've spoken to people that want to do open source contributions and they want to get involved, like, they're fantastic developers, they just don't know where to look. Like, they don't know, they don't want to spend hours making a PR to a repo and it's just going to get rejected within a couple of minutes. So it helps them to find somewhere where they've got a higher likelihood of it actually being merged in the first place, because then from there you just like turns into a mountain. It snowballs of where it can take you, opens doors, you meet new people and stuff like that. So, so far it's helped. It seems to have helped quite a lot of people finding contributions. I keep an eye on it every so often and the issues are ticking away. I've had people message me who've said that they've managed to make the very first contribution because I found a PR, which is like, I'm really happy with that. It makes me really chuffed for them. And I chose to build it really, really bare bones. The very first version of it was so basic, it's unbelievable, but I purposely made it basic because I wanted people to contribute to it. So another thing I found with people who want to contribute to open source is they're scared. Like, they're scared of making a PR and it being rejected. And I basically said to them, you will not. Yeah. Here's a basic Laravel application. I want a list put in here. I want a button put in there. I want a dark mode and light mode. And from that, people went to go make the very first contribution, not to another repo, but directly to find a PR repo because it's all open source. And from there, it's opened doors for them and given them the confidence to move on to other repositories. Now it's, I mean, it's still a basic application. It's using Livewire and it's using the Twitter API and the GitHub API. And apart from that, it's not really doing too much else. But it's the fact that it's so simple that it opened doors for people. And I think it's so far about 15 or 20 contributors. So to me, that's 15 or 20 people that have been able to get stuck into open source that might not have been able to already. I don't know if they've taken it further elsewhere, but I'd like to hope it will do, or if it hasn't done already.
Scott Keck-Warren
8:36
So I participated in Hacktoberfest last October. And so, one of the things that I found particularly challenging about it is just finding a project that I could even contribute to. Because GitHub has a page and it's like, here's all the projects that are participating in this thing. And I was like, oh, great. And I was like, okay, now that's hundreds and hundreds of pages of where's a project that I can work on? And I found one and I was able to contribute some open source code to it. And it was really like, it It felt good, right? To go like, oh, hey, here's this thing. I fixed this thing you wanted fixed. And they're like, merge. And I was like, sweet. Um, so I, I appreciate that, like, that there's an option here for people who are, are looking to do that, that, um, that contrib— uh, contributing thing.
Scott Keck-Warren
9:22
So are you looking for people to help you with, uh, find a PR? Like, do you have— if I search through there, am I gonna find stuff that you've listed?
Um, there, there were some stuff on there, some, some, uh, issues. think the majority of them have been answered so far. I wouldn't really say answered, it's not really the right kind of, uh, thing, but like someone's like submitted a PR to fix the issues and stuff. Yeah. So I think so far it's kind of at the point where it's just ticking around, ticking over in the background sort of thing. But if anyone wants to ever propose any features or if they've got any ideas, like feel free to open a discussion, open an issue, even just make the PR straight away. I'm not really that precious over it. I want people to make contributions. Uh, I'm probably not gonna reject your pull request as long as it's not really, really bad. But yeah.
Scott Keck-Warren
10:11
Okay. I find the hard part about, about getting involved in an open source repository is just like that first, you know, like, hey, I'd like to help you communication that you have with like the project. And so it's, it's good to hear that you're fairly open about all of that. So is there anything else that you want to direct our listeners to before I let you go for today?
I mean, I'd like to be a little bit cheeky and just talk about my 2 books, if that's okay. So I've been blogging for quite a while talking about Laravel and PHP and stuff like that. And I, well, I really enjoy it. And I started a newsletter. People seem to enjoy newsletters. So I thought, write a book. So I wrote 2 books, and the first one is Battle Ready Laravel, and it's basically a guide to auditing, testing, fixing, and then improving Laravel applications. The idea is you can take an existing Laravel application, follow through the book, and hopefully follow the steps. By the end of it, you'll have an improved application, and you should have picked up some skills along the way so that when you start new ones, you can, uh, like use those kind of techniques at the start so it doesn't get to that point again with it sort of having technical debt. I know technical debt is unavoidable, but there's tactics to try and avoid it. And then another one is Consuming APIs in Laravel. So that was the second book that I wrote after the first one did pretty well. And that, well, it does what it says on the tin. It teaches you how to consume APIs in Laravel. It teaches you how to use Saloon, which is a package by a guy called Sam Carré, and he's a fantastic developer, and he built this package called Saloon, which basically holds your hand for making API requests. And if you haven't already used it, I'd highly recommend checking it out. But the book talks about that. It explains, it demystifies, if you will, like OAuth and stuff like that, and all the different types of flaws in OAuth, uh, webhooks, uh, security with consuming APIs, and also the different types of APIs. It's a It's 440 pages, so it's quite a beast. And the, the printed version's just short of 600 pages. But yeah, you can check them both out and hopefully they'll help to make you a better Laravel and/or PHP developer.
Scott Keck-Warren
12:24
Yeah, I've added it to my like next read list. Like it's like I have like a, you know, a pile of books that I'm supposed to read. So it's, it's in there. So I'm looking forward to trying that out.
Oh, thank you. Hopefully you'll find it useful.
Scott Keck-Warren
12:36
Yeah, I hope so too. I'm always looking for new, new programming books. So, um, I, I do appreciate, uh, you coming today.
Yeah, thank you. Thanks for having me.
Scott Keck-Warren
12:44
I have to say another heartfelt thank you to Ashley and thank you to you for listening to this podcast. If you're not already a subscriber, make sure you subscribe with whatever your preferred method is so you can get episodes as soon as they're released and maybe share this post with a coworker who can learn from it as well. The podcast is available both as an audio version on the PHP Architect website and a video version on our YouTube channel. This is Scott Keck Warren for the PHP Architect Community Corner signing off and reminding you to keep listening, keep coding, and keep reading.