Interview with Mohamed Said, Laravel's First Employee
April 12, 2017

"Interview with Mohamed Said, Laravel's First Employee" Full Transcript

This is the full transcript of the Laravel News podcast episode #35 - “Interview with Mohamed Said, Laravel's First Employee


Jacob Bennett: [00:00:30] Good morning everyone and welcome back to the Laravel News podcast. We have a very special guest with us this morning. Mohamed, and then Mohamed you're going to have to tell me and pronounce for me your last name.

Mohamed Said: It's Said.

Jacob Bennett: Said. Okay, that's what I thought it probably was, but I hate messing up people's names. Michael is usually much better at that than I am. You should here him try and pronounce Farik's name. Michael do you want to try that for us?

Michael Dyrynda: Sure, it's Frike.

Jacob Bennett: See, much better than [00:01:00] I. We've got Mohamed Said with us on the show this morning. We have an interesting situation. Usually we are trying to overcome a 14 hour time gap between Michael and myself. This morning we've got people from three different time zones, three different continents. This was a little bit different. It is 3:30 AM for me right now. It is 10:30 for Mohamed and for Michael it is 6 PM. [00:01:30] I'm feeling it, so hopefully it doesn't come through in the interview.

Mohamed Said: You are a trooper.

Jacob Bennett: Welcome to the show Mohamed we're super glad to have you on this morning. We wanted to have you on. We were asked by a listener to have you on the show and just get some of the perspective you've had with working with Taylor and talk about a couple other things. Would you just take a minute here and introduce yourself for those people who may not be [00:02:00] familiar with who you are? Just tell us a little bit about yourself, where you're from, and then we'll talk a little bit about your journey into programming as well.

Mohamed Said: All right, well as I start my name is Mohamed Said and I'm currently living in Hurghada, Egypt. Hurghada is a small city on the Red Sea. I started programing when I was very young, like 13 years old or so. I started doing some Macromedia flash stuff in the school. [00:02:30] That's pretty much how I started doing just some short animation movies. Then I started moving toward development. Besides web development I also like swimming and diving. It's one of my hobby's that I like to do when I'm not doing programming and I'm not doing shopping with my wife, because she likes shopping too much.

Michael Dyrynda: I think that's a universal truth Mohamed.

Jacob Bennett: Yeah, that is a universal truth right there my friend.

Mohamed Said: Yes. [00:03:00] When I'm not programming, and I'm not with my wife doing shopping I just jump into the sea and try to enjoy it. It's very peaceful and I like it very much. That's pretty much who I am.

Jacob Bennett: That's very cool. Yeah, I'm looking at your picture here. We're on hangouts here and I can see your profile picture and you're at a pool. I never saw that before. Very cool. Do you do anything competitively or is always something you've done for enjoyment?

Mohamed Said: Yeah, no I just enjoy it. The fun thing is [00:03:30] before one year ago I was hating swimming. I didn't like it and I didn't like the sea. When I was very young, my trainer when I was training in swimming, he pushed me too hard that I started to hate swimming. One year ago I started to make it better with the sea, to enjoy it, and to not think about anything. Then I saw a couple of free divers [00:04:00] diving into the deep.

Jacob Bennett: Oh, that's cool.

Mohamed Said: Yeah, so I really liked what they were doing and I wanted to try to do it myself. Until some guy from Belgium he saw me trying to learn. He just grabbed me and teached me for the past four month until now I can go as deep as 20 meters in the ocean.

Jacob Bennett: Help us Americans here. How far is 20 meters? What's the conversion? Michael want to help me [00:04:30] out? Our human conversion calculator. He's going to Google it. Come on Mike.

Michael Dyrynda: Yeah, good question.

Jacob Bennett: Oh, it's 21.87 yards. No way. That's like 60 feet. You can go 60 feet under water?

Mohamed Said: Yes.

Jacob Bennett: 65 feet oh my word. What? That's insane.

Mohamed Said: Yeah.

Jacob Bennett: This is more than I occasionally swim. We're talking about free diving here where you basically hold your breath for inordinate [00:05:00] amount of times and go 65 feet underwater. Wow, that's incredible. Very cool. I had no idea you were into that. That's pretty neat.

Mohamed Said: I never thought I'd be into that.

Jacob Bennett: Yeah, we're going to have to find a place in New York at Laracon. Are you going to be able to attend Laracon, New York?

Mohamed Said: I'm not sure yet, but I'll be able to know if I will be able to make it or not during April. I hope I can make it.

Michael Dyrynda: Fingers crossed.

Jacob Bennett: Very cool. I was going to say we're going to have [00:05:30] to find a place to go free diving. Somewhere in New York. Yeah. I dont think they have very many pool-

Michael Dyrynda: Yeah, the Hudson, right?

Jacob Bennett: Yeah, the Hudson.

Michael Dyrynda: Is the Hudson far?

Jacob Bennett: There you go you got the Hudson. Yeah, we'll watch you dive off the Brooklyn Bridge and then count as you go under water there. It will be fun. Find a couple things.

Michael Dyrynda: I'm not sure Taylor would appreciate that.

Jacob Bennett: Yeah, true that's funny. Michael, do you have any experience with Macromedia Flash? Was that ever anything that you worked with?

Michael Dyrynda: I did when I was in high school. I [00:06:00] don't remember the subject, but yeah Flash was a big part of it. I was never particularly good at it. A couple of my friends spent a lot of time doing all kinds of weird animated things. They actually won an award for something they did. I wish I could find it. It was a South Parkesque animation. Which they showed off at the end of year assembly which may not necessarily have been appropriate for the [00:06:30] school audience. They did a good job of it. I could never get my head around. I got as far as motion tweening. It all became too much and that's when I started looking more into [crosstalk 00:06:42].

Jacob Bennett: Yeah, and it's funny because I have that common thread as well. Flash was the first thing that got me into programing. Maybe it was the time frame. Flash was huge on the web for a while there where it wasn't just animation. Really you were programming entire websites in flash. You and the whole preload stage [00:07:00] where you'd sit there for three minutes because you had dial up internet or whatever. Wait for this webpage to load and then have all these fancy animations.

Then I started doing action scripting which was the Macromedia Flash programming that you can do behind the scenes. You could work with objects, and instances, and move stuff around and use math. That was actually my start of web development [00:07:30] was Flash. That was where I really started to get into it and spent a lot of time on that. Is that the case for you Mohamed as well? Was it more a animation thing and then you followed the similar path to Michael where you started looking into programing rather than using Flash as the outlet for that?

Mohamed Said: Well, actually at this time I thought that the only way to build websites was using Macromedia Flash. I was interested in building websites, but that's the only tool that was available to me back then. [00:08:00] I started learning it and I built a couple of websites at school. Some informative websites about environmental issues so on so forth. After that I understood that there is a thing called HTML and there was no CSS back then, but HTML. I learned HTML and it started from there. I'm not quite sure when it actually started for me to learn Php. [00:08:30] I stayed for five years or so only doing HTML and Photoshop and stuff like that.

Jacob Bennett: Mm-hmm (affirmative), yeah that was going to be my next question. How long have you been doing Php for?

Mohamed Said: I think maybe ten years, maybe.

Jacob Bennett: Okay.

Mohamed Said: I think, but actually I started not Php. I was using WordPress to build websites. To use WordPress you don't have to be very good at Php. You just know how to start a web server and how [00:09:00] to install WordPress and that's pretty much all you need to do to have a website on WordPress.

Jacob Bennett: Yeah, you can hack around with it from there.

Mohamed Said: Yes. It's very easy too. It allows a lot of people who don't have programing knowledge to build websites and to make a living out of it. Despite the fact that many people don't like or don't appreciate how WordPress is coded, how the code is written, but it's a [00:09:30] various [inaudible 00:09:30] and I think it touched many peoples lives. It was a tool to make a living, to put food on the table. I really appreciate WordPress.

Jacob Bennett: No, that's a really good perspective on that. Yeah. It is. There's tons of people who use it. Obviously it powers, what's that statistic? It powers half the internet or something like that.

Mohamed Said: Mm-hmm (affirmative).

Michael Dyrynda: Yeah, it's good chunk. There's a lot of sites. As you say Mohamed it is super simple to get up and running. [00:10:00] Anyone can basically use it. If your goal is to have a presence on the internet it is probably the easiest. It and Wix and things like Squarespace now. WordPress has, for a long time, been the easiest way to get on the internet.

Jacob Bennett: How did you stumble into Laravel? What were you working on? What were you needing to do that led you to your first [00:10:30] Laravel project? How did you discover it?

Mohamed Said: I started my first Laravel project when it was version 4.0 just when it was released. Back then there was this guy who is very popular, but I'm not sure if I'll pronounce his name right. Dayle Rees.

Jacob Bennett: Oh, yeah Dayle Rees. Yeah, for sure.

Mohamed Said: His books was very clear on how to deal with Laravel. I got one of the books from one of my friends. He sent [00:11:00] me the book so I started reading it. I downloaded Laravel and started to play around with it. It was very, very different from WordPress how you build stuff on Laravel. I had no idea what is a controller what is a model, and how to deal with views and so on so forth. It was very different but the book was very simple. Back then Jeffrey Way, he wasn't very into Laravel as I remember or maybe I wasn't [00:11:30] following him back then. The first one who introduced me to Laravel was that book of Dayle Rees. I started when it was 4.0. I was building a small website. A lot of it wasn't very much needed. I could have done it with WordPress, but I just wanted to try to use that framework. It was three or four controllers, a couple of views, and [00:12:00] that's it. That's pretty much how I got introduced to Laravel.

Jacob Bennett: You started square one MVC framework. You just went in whole hog so it wasn't like you were introduced to the world slowly. You said, "Okay, this is a tool I want to play with and I'm going to build a little hobby project here, a little website." Then it just kind of grew there?

Mohamed Said: Yes. That's how it is. It was like a giant leap for me as I describe it [00:12:30] between how things are built using WordPress and how a MVC framework works. When I started Laravel I was looking for other alternatives because when you get to something new you need to know what's out there besides that thing you're learning. I tried [inaudible 00:12:49]. I tried KPhp, but Taylor put a lot of effort to make the syntax or to make Laravel very fluent that you write code and [00:13:00] you can read it later. It's very easy to understand how the code works and it's very easy to do some of the complicated stuff like connecting to a database and retrieving records, and doing updates and joins, and so on and so forth. It was very easy to learn and very easy to apply. That's why I use Laravel from then and I never tried to use any other MVC framework.

Jacob Bennett: Yeah, I agree. I started with CodeIgniter and that was my introduction to MVC [00:13:30] and trying to figure out what models, views, and controllers were. I had it backwards and wrong for a while. We still have legacy applications in place where we had this one single CodeIgniter installation. I think we have ten apps, maybe more, running on a single installation. We had a single controller for each app. They had their own controller and then each app had its own model [00:14:00] which was not anything like an entity in your system. It was just this is how you connect to the database for this application.

Then I had a couple views, but almost everything that I did was with Ajax and changing the page. It was almost like everything was a single page app, but not using anything that would help you do a single page app all by word. I look back at that code and it's very scary to go back to that place. I'm very thankful for Laravel. [00:14:30] That was my introduction the MVC world and then Laravel. I got into Laravel and the light bulb went on. I was like, "Oh, wait. I've been doing this all wrong this whole time. I've got all this stuff I've built and it's all wrong, but it works." It's kind of one of those things.

As things get deprecated and break and the features fall out of alignment with what our needs are we're slowly getting rid of those old applications and spinning up new Laravel applications for them. [00:15:00] There's hope out there for all of us. Even those of us who get MVC wrong for a couple years. If you can even imagine that. A couple years, maybe not a couple years, maybe a year. I know that the first time I heard your name was Laracon 2015, I believe. Do you remember? Was it 2015? When was your hire date? Do you remember when you were hired? Was it 2016?

Mohamed Said: 2016, yes.

Jacob Bennett: Okay, maybe [00:15:30] it was 2016 then. Michael do you remember at Laracon? I dont think Mohamed had been hired yet when we were at Laracon together in Louisville.

Michael Dyrynda: No. That hadn't happened yet, no.

Mohamed Said: Yeah, I was hired in September. September 2016.

Jacob Bennett: Okay, so that's what it was. A the Laracon 2016 I remember Taylor mentioning your name a couple times when he was talking about a lot of poll requests that you had made to redo a lot of the validation things that were built in Laravel. That was the first time I remember [00:16:00] hearing your name and him just talking about how you had basically taken quite a bit of time to rebuild that from the ground up, really. Were those your first contributions to Laravel, or had you always been watching, or looking around in the community and just decided to do that? Did you have a specific need or a use case that you were struggling with that drove you to do those poll requests and get started with contributing to the framework?

Mohamed Said: Well, actually my first full request to Laravel [00:16:30] is my first full request every I never contributed to any other open source project when I started contributing to Laravel. Back then I was working on a project and there was very little problem with the validation like a very tiny [inaudible 00:16:47] like something that nobody can notice. It's an age case or so. I can't remember what issue was it specifically. I started to tinker around and take a look at the source code [00:17:00] for the first time. I thought back then that I was able to fix it. I learned how to open a poll request. I did my first poll request and opened it. I think that very first one was closed. It wasn't accepted [crosstalk 00:17:16].

Jacob Bennett: We've both been there before.

Mohamed Said: I tried [crosstalk 00:17:18].

Jacob Bennett: Yeah, you work on something and ... yeah, go ahead.

Mohamed Said: I tried to to rework it until I came up with something that Taylor found acceptable and that's it. He mergered that poll request and [00:17:30] it was my first time. I liked that idea of having my code in a framework that millions use over the globe. I started to look into the validator and try to find things that I can fix or things that I can make better, or new feature that I can add new validators and stuff. That's pretty much how it all started.

Michael Dyrynda: Nice.

Jacob Bennett: I guess I was just going to say one of the really nice things about Laravel [00:18:00] and one of the things that makes it so easy to contribute to is how particular Taylor is about not just the code that he allows people to write using the framework, but the code that he writes for the framework itself. When you start digging into the internals of the framework you realize how much care and concern he's put into even the parts that are tucked back into the corners. It's all very readable and if you're looking to fix something you can work your way through the code and very logically step through the different classes and find [00:18:30] here's that particular place where this needs to change. Not to say that it can't be challenging to change things, but if there's maybe a particular bug that you're dealing with you can find it. You can read his source code which I very much appreciate. I'm totally on board with you too Mohamed. When I made my first poll request to Laravel it was just basically fixing some bug. You get that poll request merged in and it's like wow, this is awesome. It's [00:19:00] like you said that feeling of having your code in a framework that millions of people around the globe are using. That's a really cool feeling and it kind of pushes you to want to do that some more. That's really cool.

Mohamed Said: yes, it's very cool. When that first poll request was merged I keep ... whenever I meet any of my friends with their laptop and they're using Laravel and I open their laptop and I look into the source code where put my line, that's excited and I tell them this line code is [00:19:30] mine. It's on your laptop and it's on everyone's laptop, so I am global now.

Jacob Bennett: That's really cool.

Mohamed Said: I'm international.

Michael Dyrynda: Mohamed, we touched on that you are now employee, I guess technically, number one of Laravel. How did your poll request and the journey from the poll request to you putting in your resume and applying for, that job that Taylor announced late last year, what [00:20:00] was that process like for you?

Mohamed Said: During the period before Taylor announced that he wants to hire someone, during this period, I was periodically into the Laravel community trying to come up with poll requests ad feature ideas. I was speaking with people on Twitter and to try to find things that they find hard to do with Laravel to try to make it easier. I was just [00:20:30] trying to contribute as much as possible to the framework. I also tried to write some packages that might make it easier for developers to even write more functionality into their applications. Functionalities that aren't supported in the core. That was during this period. I was purely trying to get myself involved into the community as much as possible.

One thing that I'd like to mention here that people are very helpful in a lot of the community. During [00:21:00] this period I was very naive and there were a lot of stuff that I don't understand. People were very helpful. They just tried to help everyone. When they find that I'm trying to do something they try to help me. They try to install a fresh application, and try to see what I'm trying to describe, and try to replicate it themselves, and then come up with solutions for it, or come up with where is it in the code that have this specific [00:21:30] implementation or how this or that thing works. People are very helpful in a lot of the community. Maybe in the WordPress community there are a lot of good people, but since it's a very huge community when you ask a very naïve question sometimes nobody answers, or nobody cares to look at it. In the Laravel community I remember now that some of the questions that are very naïve people really care to answer me and try to help me.

During this [00:22:00] period because of this thing it made me want to contribute more and want to help more. By the time Taylor announced that he's looking for help for an employee to work with him I wasn't very sure if I'll be fit into this position. Laravel is a very big framework and Taylor, to me at least, is a very professional developer. I wasn't sure if I'll be able to fit into the job like [00:22:30] that. I'm not sure if I have the right skills. I'm not sure if I have the proper knowledge into Laravel to be able to work with the creator of the framework and help him. Anyway I talk to Taylor before that a couple of times and he ask me if I should apply to the job like if I'm interested? I told him, "Yes, I will," and I did.

It took maybe a couple of weeks before we scheduled an interview on Skype [00:23:00] where he talks about what parts of the Laravel organization he wants that employee to work on. Like to do some stuff on [Fur-zhun 00:23:13], and Voyer, and to work on Spark, and to work constantly on fixing issues on the [gah-top 00:23:19] accounts, so on so forth. A few days after that he reached out to me and told me that I'd be working with him. I [00:23:30] wasn't very sure how should I act. I was very excited, but very, very worried. I'll be working with the creator [crosstalk 00:23:41].

Michael Dyrynda: You know it's the right job if it's [crosstalk 00:23:42]

Jacob Bennett: Yeah, [crosstalk 00:23:43] for sure yeah. What do they? You don't want to be the best developer on the team, right? You want to always have somebody that's above you that's pushing you to learn more. Yeah, what an opportunity to be able to work with Taylor and learn from one of the best in our industry for sure.

Mohamed Said: Yes.

Michael Dyrynda: Yeah.

Mohamed Said: That's pretty much how I felt.

Michael Dyrynda: [00:24:00] Now that you're working there since September, so for seven months or so there abouts-

Mohamed Said: Yes, I think.

Michael Dyrynda: You've done some pretty cool things. You've brought the Four API to the masses and I see you've now, this last week, put out the unofficial [es-de-cay 00:24:21] to go along with that which would make things easier for people wanting to leverage the API. What other kind of things have you been working on? I know you mentioned [00:24:30] that Spark was one of the other bits and pieces that you were looking at. You're triaging issues and things like that on GitHub.

Mohamed Said: Yes, I constantly look into the GitHub issues of Spark and I try to replicate the issues people are reporting and to distinguish between actual [inaudible 00:24:47] or people not very familiar with how things should work. If there is a bug I try to fix it and if there is a feature request I discuss it with Taylor and [00:25:00] see if he's okay with it. If he finds it valuable to be added to the core I try to work on it until we come up with something that he can accept and the community can accept, or the customers who put spark can accept.

Otherwise for people who are just not familiar with how things should work I try to help them answer their questions and try to aid them to achieve what they are trying to achieve. That's mainly what I'm doing [00:25:30] on Spark. I'm not sure there is no schedule for the next release for Spark, but until then that's what I'll be doing. Until Taylor decides that it's time for the second big release for Spark, so we discuss what people need and what changes we can do so on and so forth to work on it. That's pretty much what I do on Spark.

Jacob Bennett: Very cool.

Michael Dyrynda: Nice.

Jacob Bennett: How has it been handling the time difference for [00:26:00] you. I know we maybe talked about this a couple minutes before we started the show. The time difference between you and Taylor is about seven hours? Something like. I think Taylor and I are in the same time zone.

Mohamed Said: Yes. I usually wake up 7:30 AM my time. I have the whole morning. I can go dive, I can go with my wife on walks or so. I can get anything done [00:26:30] in the morning until 12 PM. At this time I sit on my laptop and I start looking into get up issues. I start looking into people asking for stuff, or bugs that were introduced during the night or during the morning and try to fix them. I technically start working 12 PM. Taylor wakes up very early in the morning as well, but he doesn't reach out to me until it's 2 PM [00:27:00] my time. During this period I think he starts first to answer people on Twitter, to answer people sending him emails, support requests for Spark. He starts to look into them. I see he's active. He's answering people, he's reTweeting stuff.

We just start speaking when it's 2 PM or 3 PM here. We start to look into what we'll be doing today [00:27:30] if there is anything interesting that I should get him to look into. Like if there is a very specific bug that we've been discussing for a few days and nobody can come up with a solution. Maybe it's someone purposing a feature that I would Taylor to look into and see if we should come up with a PR or not, if he's interested to get that into the poll or not. That's pretty much how we start the day. [00:28:00] During the day every now and then he reach to me to look into specific stuff or he asks me if I saw that guy who opened an issue regarding this or that, or maybe some Spark feature requests that he would like me to look into so on and so forth.

Jacob Bennett: Very cool. It sounds like a large part of your job was helping to triage the vast number of issues and poll requests that are open across all the different Laravel [00:28:30] repositories.

Mohamed Said: Yes, yes. It takes most of my time. I'm on GitHub looking into issues and the different repositories and try to replicate them. Replicating issues like it takes a lot of time to replicate some of the age cases to try to understand why the framework behaves this way. Sometimes it's intended but it's not documented. Not everything is documented. You can't document everything. Some of the issues that people report [00:29:00] it's how it should work. It's how the code is written for it to work.

Jacob Bennett: Sure.

Mohamed Said: Other stuff are like actual bugs that I need to look into, but first I have to replicate the issue. I spent most of the time trying to replicate issues on the different repositories.

Jacob Bennett: Got you. I suppose that's kind of a good time too to ask about your setup. You spend a lot of time in GitHub. What are some of the tools you use. What's the environment that you're using to program in? Are you a Windows guy? Are you a Mac guy? Are you a Linux guy? Do you use [00:29:30] Sublime Text, PhpStorm, Vim? What is your tool set of choice?

Mohamed Said: Well, I'm using a MacBook and I'm using Valley. That's the server that use to run the different applications. I am using PhpStorm and sometimes Sublime.

Jacob Bennett: Good man.

Mohamed Said: I use Sublime when I try to edit a single file. Not a project. PhpStorm when it is a whole project that I would like to be able to [00:30:00] look into different parts of the code of different files. I think you like Php's too.

Jacob Bennett: I'm just giving Michael a big thumbs up here. This is such a funny area of contention for us. We're always talking about this which editor we're using. I'm just seeing Michael's smirk as you're saying, "Oh, yeah. I use PhpStorm for a lot of projects and Sublime for editing one offs." That's exactly what I do. I'm just rubbing Michael's face in it a little. Sorry Michael.

Michael Dyrynda: It's fine. [00:30:30] It's fine.

Mohamed Said: That's pretty much my environment. I don't have any special tools to [inaudible 00:30:35]. There are a couple of very nice Chrome extensions, but I don't use them. I tried a couple but I'm not really into them. I just deal with the interface as it is and that's it. I don't have any other special tools.

Jacob Bennett: That's awesome. It sounds very similar to what myself, and probably even Michael uses with the exception of the editor. Mr. Michael is [00:31:00] a little bit more professional than you and I. He uses Vim. Yeah, we could go on all day.

Michael Dyrynda: Yeah. I actually reformatted my work machine because it was running really, really poorly. When it got reinstalled I installed Chrome, I installed Sublime, I installed Valley, and Equal. PhpStorm is on there. I'm trying to give it a go, but I just need it to get out of my way.

Jacob Bennett: [00:31:30] I know, and Michael you don't need to reformat the computer. You just have to close those tabs that are open in Vim. You just keep opening new tabs when you can't figure out how to get out. It's :q.

Michael Dyrynda: It didn't matter.

Jacob Bennett: It's :q buddy.

Michael Dyrynda: It didn't matter.

Jacob Bennett: Oh man.

Michael Dyrynda: I also have got all [crosstalk 00:31:46] now.

Jacob Bennett: Very nice. Did you lose it? Your hard disk you said?

Michael Dyrynda: Yeah. I don't know where my disk space went. I'm hoping I can keep it free now.

Jacob Bennett: There you go. Well, Mohamed I've asked probably most of the questions that I had written down [00:32:00] here. Michael, did you have anything else that you wanted to ask Mohamed?

Michael Dyrynda: Just one. I know I'm not going to get any answers out of Mohamed on this, but it must be pretty cool working very closely with Taylor. I know that there's only a small group of people that knows what's on the horizon in terms of Laravel projects. Is that difficult for you knowing or potentially knowing more things than what the community [00:32:30] at large will know? Is it fun to be keeping those secrets or does it not really effect you too much?

Mohamed Said: I just want to say that no everything I'm familiar with. Taylor doesn't tell me everything he's working.

Michael Dyrynda: Sure.

Mohamed Said: Sometimes he shares stuff, but most of the time it's top secret even from me. It's not that I'm going to expose it, but he likes to keep everything in a very minimum environment [00:33:00] until he's very satisfied with it and he's ready to share it with others. Speaking of Horizon, yes I know what is it. I know but I can't say.

Jacob Bennett: I was going to say the next question is do you care to share what Horizon is with our listening audience. I think we figured that's what the answer would be, but hey you got to try.

Mohamed Said: No.

Michael Dyrynda: That's right.

Mohamed Said: I can't.

Michael Dyrynda: I'm sure we're all looking forward to finding out what [00:33:30] Horizon is. It should be a good announcement hopefully at Laracon in New York this year.

Jacob Bennett: Yeah, absolutely. I know there's been some rumblings in the community as far as hunches as far as to what people think it is. I still have no clue, not a clue.

Michael Dyrynda: It probably is some way to stop you from using PhpStorm.

Jacob Bennett: Interesting. I don't know if you're yanking my chain or not. I can't tell. All right, well we'll end on that note. Leave everybody on a [00:34:00] little bit of mystery. Mohamed thank you so much for taking time to come on the show with us this morning. It's been really great talking to you.

Mohamed Said: Thank you so much. Thank you Jacob and thank you Michael.

Michael Dyrynda: Yeah. Thanks man.

Jacob Bennett: Yeah, hopefully we get a chance to see you at Laracon this year. That'd be awesome.

Mohamed Said: I really hope.

Jacob Bennett: All right, sounds good. Thanks man.

Michael Dyrynda: Cool.

Mohamed Said: Thank you.

Michael Dyrynda: Take it easy.

Jacob Bennett: I want to take a quick second here to recognize the first sponsor that we've had since Michael and I have actually been doing the podcast. We're super excited to have partnered with Eyewitness.io. I'm [00:34:30] going to spell that for you so that you can go check out their website. It's E-Y-E witness.io just so you don't get confused with that. Eyewitness is a monitoring solution for your Laravel applications. There's plenty of monitoring solutions out there that you could choose, but one of the things that I really like about Eyewitness is the installation is incredibly simple. All of the configuration and things like that is actually handled by the package itself.

All you have to do to get started is compose or acquire Eyewittness/eye. [00:35:00] No publishing needed. You just push in the service provider and run a command and that's it. There's no config changes or anything. It literally takes about 15 seconds to install. Not withstanding composer changes and things like that. Some of the things it offers is Q monitoring. I've had this happen plenty of times before where I'll be running a database queue in the background and it's silently failing. I don't find out about it until maybe the next day, so I have donations that were supposed to run the day previous and I now I have to explain to the people who were waiting for them why it took an extra [00:35:30] day. This has got a queue monitoring that will let you know if your queues are backing up. It will let you see you have a thousand queues waiting to be done so you need to go check that out.

It will handle failed queues. When you get a queue that does fail it actually provides a really nice little user interface for you where you can quickly retry or delete any failed jobs or retry all jobs without even having to SSH into the server. You can just jump onto the UI and do it straight from there. You can look at all of your [kron 00:35:57] jobs and your scheduler jobs that are running [00:36:00] and when they've last run. Which is incredibly helpful if you're not using Envoyer, which Taylor Otwell created of course which has heartbeats. This is a great way to do that. This actually provides quite a bit more detail as far as when they last ran. Heartbeats on Envoyer will let you know if you give it a warning time. Hey, this supposed to run another 15 minutes. It will hit you with a slack message. This will tell you when it last ran, what the schedule status is, what your [kron 00:36:25] schedule is, when it's next due to run.

They've got log management. You can [00:36:30] remotely view your logs directly from your dashboard. They've got email monitoring. They've literally got everything that I could possibly have thought of in one package and it's ten dollars per application which is incredibly reasonable if you have anything in production. I would highly recommend you check Eyewitness.io out. We're super glad to have them as a sponsor this week. Oh, I also wanted to mention as well, before I forget here, I mentioned it's $10 for an application. They also have a 14 day free trial that you can use. Just head [00:37:00] over to the website and you should be able to try that out real quickly as well. They also have a really generous cancellation policy. You can get back 30 days money back guarantee. They're very confident in their service that you'll like it once you start using it. Definitely check that out. That was a good talk. That was fun. Actually that was Mohamed's first interview he said. He did a great job.

Michael Dyrynda: Yeah.

Jacob Bennett: That was really cool.

Michael Dyrynda: He did a great job for a first interview, yeah. I'm surprised no [00:37:30] one's interviewed him until now.

Jacob Bennett: I am as well. I'm honored that we got to be the first.

Michael Dyrynda: Very much so.

Jacob Bennett: Let's jump into some of the things that were put out in Laravel news the last two weeks. One of the things that I'm pretty excited about that was released is, and I suppose not released yet, it was slotted to be released in 5.5, is that you can now ... I say now. You will be able to render mailables to the browser. Have you ever had that situation where you're trying to build an email? [00:38:00] Maybe a welcome email or maybe a we are announcing this thing and you constantly have to send it to Mailtrap or to Litmus or to something like that so you can actually see a preview of that HTML marked on email. Have you ever had that situation?

Michael Dyrynda: Mm-hmm (affirmative).

Jacob Bennett: Yeah, usually what I almost end up doing a lot of times is before it was using Markdown or whatever. I would actually make an HTML view. Then I would render it out in a route just so I [00:38:30] could take a look at it. I think Farik actually had mentioned this. Basically said, "It would be really nice if we could do this. If we could render these mailables in the browsers." I know there was some back and forth as far as what that looked like. The way that you accomplish this really is you make a test route in your web.Php routes file.

Then you just return the mailable so that you have these mailable classes. You say return new and then whatever the name of your mailable class would be, so welcome email maybe. [00:39:00] It will render that out as HTML and spit it out to your browser. It allows you to quickly iterate on your design and on the different pieces that you need to change to get it to look like exactly what you want. Then when you're done you just do what you normally do. Which would be mail, send, and then the name of your mailable, so that's pretty cool.

Michael Dyrynda: Pretty cool. Pretty easy.

Jacob Bennett: Yeah. Along with that in 5.4 there was the introduction of markdown emails. Of the things you can actually do right now, and it ships with a default theme, but [00:39:30] you can actually generate your own custom theme were you can write your own CSS for the buttons, and for the headers, and the body, and the tables, and different things like that. You can do that right now which is great. In 5.5 it's going actually make it even easier to switch between some of those themes. Basically the way you do it is you write your own custom CSS file and you drop it in a specific location in the framework directory. I think maybe in your [00:40:00] mail configs, your mail.Php I think you change what the theme is. In 5.5 you will actually be able to specify per mailable theme. You can say this specific mailable I want it to use this theme. Then this next mailable I want it to use a different theme. That's kind of interesting. It's just specified on the mailable class itself as a protected variable.

Michael Dyrynda: Nice and easy.

Jacob Bennett: Yeah, absolutely. The next thing I wanted to talk about was Dusk tests on continuous integration [00:40:30] platforms. Have you gotten a chance to mess with any of the Dusk test stuff?

Michael Dyrynda: I have started running tests in 5.4 which I guess is Dusk, right?

Jacob Bennett: That's right.

Michael Dyrynda: Yeah, but not any CI platform as yet.

Jacob Bennett: Yeah, so you can run them locally which is awesome. It's really helpful for sure. One of the challenges we faced was we were able to run these locally, but we basically had to remember them locally before we pushed production code. Our gab repositories are hooked up [00:41:00] with StyleCI and Travis which are both continuous integration pipeline little things. Travis was not really able to do our Dusk tests which was good and bad. Good in that our tests ran faster. All of our Php unit tests that we normally would have run, run on Travis. No big deal. We had messed around with trying to get it to work, trying to get Dusk tests to work on Travis and just had not had any success.

Mohamed, I think had posted something [00:41:30] about this and had been working on this. They've got it working now on Travis and on StyleCI. There's a tutorial on Laravel news out there. Basically what the specific things that you need to do in order to make that possible. I think some of them are just which sort of box you're using. I know that on Travis you need to use the pseudo enabled [oo-boon-two 00:41:51], trust the environment which has the correct Chrome version that Dusk uses, the Chrome driver. Whatever [00:42:00] that magic is that works in the background. That's the sort of setup that you need to use to make that work. Then they've got an example Travis.yamelfile out there. Then they've got some stuff for CircleCI as well for those who might be using that. Very cool. Very much appreciate it. I'm definitely going to be making this part of our deployment process. I guess not deployment process. Part of our process of getting code approved and merged into our production branch, so looking forward to that.

Michael Dyrynda: Yeah, cool. We'll put a link in that one in [00:42:30] the show as well.

Jacob Bennett: Do you want to talk a little bit about migrations?

Michael Dyrynda: Yeah. As part of Laravel 54.17 that came out this past week there was an announcement that the way that the Laravel migrations are run is going to change. For anyone who's been playing along and listening into what some people have been saying in the community there's this faction I guess [00:43:00] that doesn't believe in the down migration method and rolling back migrations and things like that which can run into some issues. There's a couple of ways of working around it so that those down migrations are never run. They might blow away your entire database and then rerun your migrations from scratch.

Now if you don't want to have a down migration so that you can roll back what the migrations will do for you is it the down method or even the method does [00:43:30] not exist? Then instead of exploring how it does currently it will just skip that migration. Anywhere you're defining foreign key constraints and things like that, which can have issues in being rolled backwards from time to time depending on what data you have and how that foreign key came into existence, if you could omit the down method in your migration going forward as of 5.4.17 the migration just [00:44:00] won't run that down method and skip onto the next one in the chain. That's handy in those instances.

Jacob Bennett: Yeah. I don't know if I've ever necessarily had a time where I rolled back a single one in production, a single migration. That's kind of the use case though. You've got a migration that you're running on your production stuff and you run the command and it does up which maybe adds a column or does a couple things, creates a new table, [00:44:30] whatever. Then the idea is that in the case that that broke everything you can run the Phpr in migrate. Not down, I guess it's going to be revert or something like that. I can't remember exactly what the command is. Maybe it's roll back. I think maybe roll back.

Michael Dyrynda: Yeah, roll back.

Jacob Bennett: It will take off your most recent migration. It will run the down method. In theory that's kind of what it's supposed to do. Again, I don't know if I've actually ever done that on a production app. Maybe one time. Maybe one time. I think the argument [00:45:00] is that sometimes the down method can cause a little bit more hassle than not. If you get stuck in the middle of a set of down migrations it can cause some issues. If something freaked out during your down maybe it removed a table already on the first command, and the second command causes an error. Well, when you go to run it again Laravel's going to say I never completed that migrate down. It's going to try to remove that table again and it's already gone. Now it's going to fail on the first one and so now you're stuck.

What you have to do in those situations is you [00:45:30] have to go blow away the entire migration's table in your database and you got to start from scratch anyway. That was addressed actually in 5.5. There's going to be a new helper to handle almost that exact situation which is the new fresh command. You say migrate:fresh. What that does it complete ignores in down methods that you would even have. It drops all the tables and just starts fresh. It starts running at the beginning [00:46:00] and does through all your up methods on your migrations. That's kind of handy. There's definitely times I would use that.

Michael Dyrynda: Yeah, I would still be careful. These are the kinds of things that generally are going to run during development. Obviously you don't want to drop your production database unless you've taken a backup of it. Always take a backup. Anytime you're messing with any of your production data or any data that is critical to running your application. [00:46:30] Obviously run backups, but basically ignoring the fact that foreign keys exist is potentially going to lead to some issues down the track. I know that that is often a stumbling block if you're running a down migration and you get those cryptic [inaudible 00:46:45] errors where it's like error 150 something about your foreign key and you've got to go and figure out what it is that doesn't match up.

As I said always take a backup of your data base anytime you're going [00:47:00] to migrate. That is probably the key take away no matter how you choose to go about running your migrations. Whether you do do your down migrations or if you're always doing a role forward if you come into an issue with running that migration in production, you have some issue or whatever, rather than trying to revert and whatever else to play an older version of your code and restore your data base back up. When you fix it, I would generally myself [00:47:30] look to create a new version of my code base that fixes the issue by rolling forward, by introducing some new functionality rather than trying to figure out how to go backwards.

Jacob Bennett: Yeah, Taylor had said something at one point which was basically like his idea was, "I don't create breaking migrations ever." That was his answer. "I just don't do that. Just don't do stupid stuff with your migrations and you should be all set." On 5.4.17 there was also something called the times method released [00:48:00] on the Laravel collection stuff. You want to talk about that real quick, Michael?

Michael Dyrynda: Yeah, so it's basically a times method on the collection class which allows you to basically carry out some action a certain number of times. The example that we've got in the post on Laravel news and thanks to Joseph Silba, for the contribution of this method. It allows you to basically generate a numerically indexed slug, so you could run the times method five [00:48:30] times, and each time return the incremented value. I guess you could think of it as basically a followup in a collection pipeline which is handy if you wanted to ... The other example that they have here is showing generating products using model factories. Then each time you create a new product it would increment the product numbers. You'd have product number one, number two, up until you get to however many times that you wanted to run through that collection.

Jacob Bennett: Yeah, so it basically builds up a collection for you so you can say, "Hey, [00:49:00] iterate over this five times." Typically what I had done in the past with this is I would do a collection of a range. I'd say collect and then range 1, 5, I think or something like that. Basically I would get a collection of the keys that I wanted and then I would do an each or a map over those and do it that way. This makes us more convenient and a faster way to do that exact same thing.

Michael Dyrynda: Yeah.

Jacob Bennett: Earlier this week I was actually browsing around on one of Spatey's [00:49:30] opensource packages for Laravel. I'm trying to remember exactly what one it was. Oh, it was dealing with view validation. I was looking through the code and had noticed that Farik had in there, in one of his routes, maybe that's not even the right word to say. One of his URLs that he was referencing he had used the word action. I didn't understand what that was. I was like what is action? He's generating a URL using the word action, so I opened [00:50:00] up my handy PhpStorm typed in the word action and command clicked that thing and it took me right to the source. Wow, isn't that amazing how that works? I just looked at that. Go ahead what's your snappy remark?

Michael Dyrynda: My Sublime [crosstalk 00:50:15] does that as well.

Jacob Bennett: [crosstalk 00:50:15] I know. I've seen Adam do it too. It's pretty cool. It basically is another way to generate a URL. The way that it works is to reference a controller, and a method on that controller, and then [00:50:30] generate the URL to that location. I had never seen this before and it's been out forever. I think since four something and I somehow missed that. I was curious and said I wonder how many other people are using this? Am I the only one who doesn't know about this? I put a Twitter poll out there and said, "Which way is it you guys and girls are generating your URLs?" The three options were action, are you suing action, are you using [00:51:00] the route helper, or are you just using plain string URLs? Overwhelmingly the response was that people use the route method. 77% of the voters, which out of 500 total, used the route helper.

Laravel news, Eric Barnes, wrote up a post on this and said ... his take on it I think was that he uses string URLs on a lot of stuff. Which I was appalled about. Eric, how dare you. [00:51:30] He took the time to breakdown all the different options you have for generating URLs. We talked about action already and how you can pass the controller and the method. You'd say, "Action user controller at profile" just like you specify in your routes. File you give the name of the controller at and then the name of the method. That's exactly what you do when you use the action helper to generate a URL. It's the same signature. Then [00:52:00] you can also pass through parameters after that as a second argument. If your route takes parameters like the ID of a product or something like that you can pass that through as well as a second parameter.

You also have the Laravel route helper which the way that you utilize that is to actually name a route in your routes file. If you've been using routes for any amount of time you're probably familiar with what that is. You can give your routes a name and there's convention around that. If I have a users [00:52:30] table and I wanted to create a new user the way that you would name that would be users or user.create. That's how you would reference it in route helper. You'd say, "Route user.create" and that's going to generate a URL link for you pointing to that route location.

There is also another one which I have never really used which is the Laravel URL helper which basically what it does is it prepends any relative path that you have as a absolutely path. If you had put [00:53:00] in URL and then user/profile it would return a full URL string to the name of your website, so HTTP:// et cetera and then the user profile on the end. Then you just have straight up user strings which some people use and not a fan. I'm just kidding it really does depend on the size of your application. What were you going to say there Michael?

Michael Dyrynda: Yeah, I think when it comes down to it the route helper and the action helper both work in a very similar way. [00:53:30] They're both going through your routes file. One's matching on the route name key or the name of your route. The action helper is looking at the users portion of the route. I think conventionally, is that a word, by convention using the route helper is probably less cognitive overhead. As you said it's users.great or users.show and it's going to be the same for users as it is for posts, [00:54:00] as it is for whatever else if you're following that convention.

Action helper's I guess the same. It's probably going to be more keystrokes. I dont think it's necessarily going to be that much quicker or faster. I certainly wouldn't use ... actually that's a lie. The only place I use the URL helper is for public access. You know static things within the image, you know, public images or something like that. The only place I use the URL strings [00:54:30] myself is where Laravel's off boiler plate. -uses them for log in, and log out, and register. Those kind of tins are fairly plain and they're not going to change.

Jacob Bennett: One other thing that I use I use route everywhere. You had said something on Twitter about, "I don't ever see people using route in their tests." I'm raising my hand right now. You can see it on the screen. I use route in my tests all the time. The other advantage that, I suppose action and route both [00:55:00] hold this advantage, which is that you can change the actual URL that your application would use. You don't have to update any of the pads in your application.

If I decide later that I want to create new users by instead of going to user/create if I wanted to be users or I wanted to be invitee/ or something like that, if I want to actually change the URL structure that my application is going to use, I don't have to go through any of my code to change [00:55:30] any of that because it's specifying a route name anytime I'm using route or it's specifying a controller and a method when I'm using action. Those are the benefits that route and action get you. I just thought we'd mention those on the air real quick. They are worth discussing for sure.

Michael Dyrynda: Yeah.

Jacob Bennett: Cool. We've also got the Laravel forge Php SDK. Michael do you want to talk about that?

Michael Dyrynda: Yeah, we touched on it briefly when we spoke with Mohamed earlier in the podcast. There is a post on Laravel news [00:56:00] which we'll link in the show notes that goes into a bit more detail about that and a different method. Obviously being in SDK it's a wrapper around the forge API. This is quote unquote an unofficial SDK. Was this been written by Mohamed himself? It's not released under the Laravel organization or anything at this time. Just an easy way of talking with the forge API through your Php application if that's what you wanted to do.

Jacob Bennett: Very cool.

Michael Dyrynda: [00:56:30] Yeah, and I guess there were probably three or four different packages in [sh-it-or-oh 00:56:35] was there that were published on Laravel news this week. Unfortunately we don't have anymore time. We've held you on long enough. We will certainly link them up in the show notes and you can check them out there.

Jacob Bennett: Excellent. All right, well thanks so much for taking the time to record this morning, Michael. Actually I should be thanking me. I'm thanking me right now.

Michael Dyrynda: Thank you. Absolutely.

Jacob Bennett: Okay, [00:57:00] I think that wraps it up then. Thank you everyone so much for listening. This is episode 35 so you can find show notes for this episode at Laravel-news.com/podcast/35. If you like the episode please feel free to rate us up in iTunes or your pod catcher of choice. We always appreciate getting five star reviews. If you have any questions please feel free to reach out to Michael or myself on our personal Twitter accounts or at Laravel news. Michael, always a great time. Man, I am going to go to bed.

Michael Dyrynda: Always, thank you so much for getting up. I think must be my turn [00:57:30] next time.

Jacob Bennett: I think so. All right, take it easy.

Michael Dyrynda: All right have a good one.

Laravel News Partners

Newsletter

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