Laracon Sessions with Tom Schlick
May 23, 2017

"Laracon Sessions with Tom Schlick" Full Transcript

This is the full transcript of the Laravel News podcast episode #38 - “Laracon Sessions with Tom Schlick

Jacob Bennett: Hey [00:00:30] everyone. Welcome back to the Laravel News Podcast. Again, this week we have with us another one of the speakers who's going to be giving a talk at Laracon. Mr. Tom Schlick is joining us on the show. Tom, welcome.

Tom Schlick: Hey, how's it going?

Jacob Bennett: Going well, going well. Hey, we met, I think, at Laracon in New York in 2015, I think.

Tom Schlick: I believe so.

Jacob Bennett: Briefly in the lobby, maybe, I think.

Tom Schlick: Yeah, I believe so.

Jacob Bennett: And then last year we had a head-on-head battle to see who could most quickly develop a HTTP2 [00:01:00] middleware for Laravel.

Tom Schlick: Right.

Jacob Bennett: After Ben Ramsey's talk about HTTP2. So that was fun.

Tom Schlick: Yeah.

Jacob Bennett: Anyway, yeah, glad to have you on the show today and we're just gonna kinda go through the standard questions here, get to know a little bit about you. We'll start off from there. For those people who don't know you or aren't familiar with you, could you tell us who you are, where you're from, and where you work.

Tom Schlick: Yeah, so my name's Tom Schlick. That's Tom Schlick on Twitter. I'm from Pittsburgh, PA. I [00:01:30] work for a company called RunMyBusiness. Basically, we develop software for the commercial real estate industry. We help them manage, market, and sell properties.

Jacob Bennett: Very cool. We actually got a chance to talk for a little bit before the show. Poor Michael Dyrynda. I'm so sad for him, right now. He had some technical difficulties this morning. We started getting the Google Hangout going and it sounded like there was gunfire at his house. It was a little bit scary. Apparently, his [00:02:00] USB flaked out. He lost some stuff. Sad day for Michael, but as a result, Tom and I got a chance to talk a little bit about what he's doing at work and it sounds like you guys are up to some pretty cool stuff. Yeah, very cool. I'll have to check that out.

Something we like to ask all of our guests is just about your journey into development and where you first really became interested in computers and programming. Would you like to talk about that just for a couple minutes?

Tom Schlick: Yeah sure. I've always been really interested in computers, but I never really started [00:02:30] developing anything until actually my friend had a Halo 2 clan for Xbox and we wanted a website for it, so I bought an HTML book. I was probably like 13 or 14 at the time. Borrowed an HTML book, and then realized, "Oh crap. I need PHP to do some of the things we wanted to do." And actually, the PHP side was a funny journey. I actually tried [00:03:00] to start learning ASP. Not even, ASP, because that's what I saw there was a bunch of articles back then on that. I found out that the server that I actually spun up was a Linux server. So it didn't support ASP. So I was like, "Oh, I'll just move to PHP then."

Jacob Bennett: Nice.

Tom Schlick: That's actually how I got started with PHP was by mistake.

Jacob Bennett: That's funny. So you've been doing that since 13 or 14. When did it become like a job for you?

Tom Schlick: I [00:03:30] mean, in high school I started really getting into it and started doing side projects and things like that, but I never went to college for it, so as soon as I got out of high school, I just started working at a company doing development for ... We actually did ... It's called [inaudible 00:03:46]. The idea was kind of tracking legislation and things like that. That was right around 2008 though, so funding was drying up as that housing bubble and everything started to happen with the economy. [00:04:00] That didn't really take off, but that was my first stint into programming.

Jacob Bennett: Yeah and you've been using Laravel for a while now. Like I said, I mean, I saw you at Laracon 2015. What version did you start with? How did you discover Laravel or become part of the community?

Tom Schlick: This application that we've been developing, we've been developing probably since ... I started as a freelancer so actually during my first job, I was freelancing for the company I'm currently at, and we actually started in CodeIgniter, created the minimum viable [00:04:30] product, then we went to FuelPHP and FuelPHP kind of imploded after a certain point, so right around version 4, at the first Laracon actually, I went to the first Laracon without ever using Laravel. I had read the documentation. I knew Jesse O'Brien and a bunch of people that were using it, and basically I said to my boss, "Hey, you should send me to this because we're looking at Laravel." Went to Laracon, the first one in D.C., and basically fell in with Laravel. We really started [00:05:00] converting everything over right around version 4.0.

Jacob Bennett: Awesome. Very cool, yeah. You said that was 2014?

Tom Schlick: Maybe 2013. I think that was 2013.

Jacob Bennett: It was a pretty small group at that point, right, the first Laracon?

Tom Schlick: Yeah I think it was only like 120, 150 people, something like that. I remember we all fit in a small room on top of ... I don't remember where it was. [00:05:30] The Living Social headquarters had an event room type of thing and we all fit in there. So, yeah, that was probably right around 150 people.

Jacob Bennett: Yeah, so from 150 people up to a venue that holds 600 and 600 more on the waiting list.

Tom Schlick: Right.

Jacob Bennett: That's crazy.

Tom Schlick: Yeah.

Michael Dyrynda: So, Tom, from conference attendee, you're now going to be giving your first presentation this year. Did you want to talk a little bit about, I guess, how you ended up becoming a speaker and [00:06:00] a little bit about what you're going to be speaking about at Laracon?

Tom Schlick: Sure. Basically, with building this app, my talk's gonna be on multi-tenancy in Laravel, so having multiple customers have data in a Laravel application, basically your default software as a service. With the type of customer we have where they're releasing these hundred million dollar properties for people to submit documents on and things like that, the information [00:06:30] is really sensitive, so one of the things a lot of our customers demand is keeping that data separate from each other. Obviously, you wouldn't want to show hundred million dollar financial documents to somebody who wasn't allowed to see them or from a totally different company, that kind of thing.

I'm giving the talk on multi-tenancy and basically, how we deal with multi-tenancy, in the different types of multi-tenancy. As I was telling Jacob before this, there's a single database approach to multi-tenancy [00:07:00] and there's multiple databases approach to multi-tenancy, so giving a talk on the pros and cons of each and how to get you started in each.

Jacob Bennett: Yeah, so we got a chance to talk just a little bit before and I gotta say, I thought I had a decent idea around what multi-tenancy involved, but we were just talking about some blog posts that you had written out there and I'm really excited to hear this talk. Just in talking for a couple of minutes, there's some really interesting ideas and approaches to how you handle multi-tenancy. I'm [00:07:30] really excited about this talk. I can't wait. Tom Schlick: Well, thanks. I hope that other people like it.

Michael Dyrynda: Yeah, I think anytime that the main Laravel podcast would tweet what do you want to hear us talk about, multi-tenancy is always a hot button topic so I think you're onto something with the community there. I'm really looking forward to hearing the talk. We're doing a bit of multi-tenancy stuff. You and I have spoken about it briefly in the past, as well.

So obviously you've got quite a bit of experience with all of this stuff, Tom, [00:08:00] and what sort of drew you to the prospect of becoming a Laracon speaker?

Tom Schlick: It was one of the ... I talked to people about how they set up their apps and things like that over the past four Laracons, and basically every time I got to how we were setting up ours, everyone, their eyes lit up and said, "Oh you should give a talk on that" or "That's an awesome idea. You should create a package." So, it's something I've [inaudible 00:08:28] for the past couple years, but [00:08:30] finally at the last Laracon, I forget who I was telling how we set up our stuff, but they were very adamant that I should give a talk on it. I thought about it and when Taylor put out the call for [docks 00:08:42], I submitted a three line thing just shoot it out, see what happens and I got accepted. Yeah, super excited to give a talk on it.

Michael Dyrynda: And then you'll very quickly be known as the multi-tenancy guy.

Jacob Bennett: Yeah, that is true. Watch out because you will forever now [00:09:00] be known as Mr. Multi-Tenancy.

Tom Schlick: Right.

Jacob Bennett: You're gonna be like on Twitter, every time somebody has a question, Taylor's gonna be like, "Go talk to Tom, he gave a talk about that."

Tom Schlick: Oh he already did that. Somebody was asking him about it and basically he replied and said, "Oh, talk to Tom." And I got like 20 Twitter messages with people asking questions, which wasn't a bad thing because actually I now have a folder where I just save all of those conversations just so that I can go back to them for my talk and answer the common [00:09:30] questions that people might have, in my talk.

Jacob Bennett: You know the next step though? You know what happens? After you give a talk about a topic like this, it's an ebook or it's a course or it's whatever, and then you quit your job and become a thousandaire and yeah, there you go. Make some money on being Mr. Multi-Tenancy. This is a good thing for you.

Tom Schlick: Yeah, definitely.

Jacob Bennett: Very cool, very cool. Well, let's see. I think that's through the main list of most of our speaker questions we have. One of the things we also are doing is we are asking [00:10:00] each speaker to provide us three songs to add to our Laracon playlist. So this is an idea that Michael had where we're just taking songs that maybe are within your genre of music that you like. So, I won't put you on the spot, but what kind of music do you like?

Tom Schlick: See, this is gonna be hard because I literally like everything.

Jacob Bennett: Yeah?

Tom Schlick: I can go from 70s to current stuff to country to rock to whatever.

Jacob Bennett: Do you like Korean Pop [00:10:30] music?

Tom Schlick: No.

Jacob Bennett: Oh so you don't like everything.

Tom Schlick: So not everything, but a wide variety of things, yes.

Jacob Bennett: I found myself on that playlist the other day on Spotify. It was like K-Pop. I'm like, what's this? I was like, oh my gosh. Korean Pop. It's a thing. A lot of people like it.

Tom Schlick: I turned off the public activity feed of what I listen to because you're developing something and three hours later, you're like three hours into a Korean Pop playlist and you're like I don't [00:11:00] know where this came from. I don't even like this music. I just haven't been paying attention.

Jacob Bennett: That's exactly right. I think that's what happened.

Michael Dyrynda: I've turned that activity thing off as well because every now and then you want to go and find something that you liked or a page that's disappeared in Facebook and it's just like hours and hours and pages and pages of Michael has listened to this. Michael has listened to this.

Jacob Bennett: Exactly.

Tom Schlick: And then your friend see it and they're like, "Hey you were listening to Justin Bieber for three hours last Friday." You're like, no.

Jacob Bennett: I like Justin Bieber. So sue me. [00:11:30] I hear that Taylor likes Justin Bieber. Does Taylor like Justin Bieber? One of those guys likes Justin Bieber.

Michael Dyrynda: Taylor Swift.

Jacob Bennett: [inaudible 00:11:37] One of those guys. Okay, last thing real quick here. So, when you said you were submitting a talk, did you say you just submitted a three line ... Is it just an idea? Is that what you submitted?

Tom Schlick: So basically, the form that he had out for the call for papers or call for presentations was basically just a type form, which basically just like four blobs of information you need to put in [00:12:00] and, yeah, the talk was just the general abstract of what you would talk about. I basically submitted who I am, how I know about this, and the general idea of it, and then I also link to a blog post I had done a couple years ago that described certain things you can do with single versus multi database, multi-tenancy setups. Just submitted that and it was probably two or three weeks, and Taylor messaged me on Twitter and said, [00:12:30] "Hey, I'm gonna accept your Laracon talk. Send me your headshot and all of this other information."

Jacob Bennett: Awesome.

Tom Schlick: A couple weeks after that, he announced that officially and good to go.

Jacob Bennett: Very cool. Now the work begins, right?

Tom Schlick: Yeah, now the excruciating going through every slide a thousand times to make sure I don't look like an idiot.

Jacob Bennett: No, you'll do great. You'll do great. Really looking forward to it. Thanks so much for coming on today, man, and taking some time with us.

Tom Schlick: Yeah, no problem. I was [00:13:00] excited to come on and thanks for having me on.

Jacob Bennett: Yeah, absolutely. Michael, you got anything else?

Michael Dyrynda: Yep. I do.

Jacob Bennett: Oh he does. Go ahead, man.

Michael Dyrynda: Speaking about different levels of multi-tenancy, and I know you're gonna go into greater detail at Laracon, so I won't steal too much content from you, but what is your preference? Not only what is your preference, do you have a separate database for each tenant, or do you just have like a tenant ID? Do you prefer one or the other? Which one do you use primarily for the work you're doing?

Tom Schlick: [00:13:30] Right. So for work, we definitely use separate databases. So basically, and this isn't giving too much away from my talk, so basically we have a separate database per tenant and then we have a shared database that acts as kind of the router for that. Inside that shared database, we keep things like the mapping from domain name to the tenant ID and things like that, but all of the core information about the client lives in their [00:14:00] own database. But really it depends on the type of app you're building. If you have an app that shares data between clients, so for instance, not a Twitter feed, but I'm trying to think of a good example here. Maybe something like a GitHub where you're gonna have both private data and shared data, public data, stuff that mixes together, you probably want to go with a single database, but if your clients never share information, think something like a Slack where they don't share users, [00:14:30] they don't share data, and you want to go to something like a multi database.

Michael Dyrynda: That may be an example of using the wrong approach, I think.

Tom Schlick: Yeah maybe, but I was getting at they don't share users, they don't share data in that aspect.

Jacob Bennett: It'll be interesting to hear ... We talked a little bit about kinda how you handle migrations across multiple databases like that, and how you go about spinning up a database when a user signs up or whatever. Those'll be some really interesting, some of the finer points that you [00:15:00] maybe wouldn't consider if you were just like, "Oh yeah. Multiple databases sounds like a great idea. Let's do that." It's more of like the nitty gritty, these are the problems you're gonna run into, if you do that. It's a trade-off always, right?

Tom Schlick: Right.

Jacob Bennett: But it gives you a lot more flexibility. One of the things that you had told me was the ability to basically, if you have a really heavy user, you just take that database and put it on its own server or whatever.

Tom Schlick: Right.

Jacob Bennett: Yeah, that's pretty cool.

Tom Schlick: And then also, one of the big things is we've seen in the last couple years, the software as a service, people are now offering it on premise because a lot of [00:15:30] companies, they want to secure their data or they want to make sure, if you as a company go away, they still have that application. In that case, there's no work you need to do to move them from your software as a service application to their on-premise setup. So think of GitHub Enterprise or something like that. It's the same kind of thing where you can just take their database, provision a web server, whether it was in their own data center or on their own AWS account, for instance, and just [00:16:00] throw their database into it, and they have all their data. They have everything since the beginning of time. You don't have to split it out, things like that.

Jacob Bennett: Oh man. The more you talk about this, the more it sounds like a really awesome option.

Tom Schlick: Yeah.

Jacob Bennett: Yeah, very cool. All right, Michael. Last call. Are you good? Anything else?

Michael Dyrynda: Yeah, I'll get that list of three songs from you later on. I've decided that I'm not going to say who owns which song and to make that more difficult to guess, when we got Freek's tracks [00:16:30] last week, I mingled them with some other speaker tracks as well. Not speakers that we've spoken to, but certainly speakers that will be attending. Get them through to me when you can and we'll get that playlist updated.

Tom Schlick: Sounds good.

Jacob Bennett: Of course, I will know. Michael, you'll tell me, won't you?

Michael Dyrynda: Maybe. There's nothing on the line here. No prizes or anything, but it might be fun to see if people want to have a stab at guessing the songs. We'll have the link in the show notes, obviously.

Jacob Bennett: Very cool. Awesome. Well [00:17:00] thanks again, Tom. It's been good talking, man.

Tom Schlick: Yeah, it's been great to be on.

Jacob Bennett: All right. Sounds good. We'll see you at Laracon NYC in a couple months.

Tom Schlick: Yep, can't wait.

Michael Dyrynda: See you there. Bye.

Jacob Bennett: Take it easy.

Tom Schlick: See you guys.

Jacob Bennett: We've got a couple other items we wanted to talk about. Really only two, I think, so kind of a light news week. We've got the first one on the list is Laravel throw_if, then throw_unless helpers. So this is coming in Laravel 5.5 and what this is is it's a little global helper method that allows you to quickly evaluate a Boolean [00:17:30] and throw an exception based on its truthiness. So, throw_if will except a Boolean for its first argument and an exception for its second argument and if that is true, if the Boolean evaluates to true, it will throw that exception. If it evaluates to false, it will not. throw_unless, of course, is the exact opposite of that. If it evaluates to true, it will not throw. If it evaluates to false, it will.

There's a couple different ways that you can construct this, depending on how you pass in the arguments. You can either pass in for [00:18:00] your second argument, a new [inaudible 00:18:01] exception with the message that you want to throw with the exception or you can pass just the class as a string reference and then the message that you want after that.

In any case, there is a vlog post out there on Laravel News that gives you some code snippets you can take a look at, and it will clean up your code a little bit. Pretty cool. I plan on using this in the future, for sure.

We've also got 5.4.22, which, there's a couple things to know, but one of the biggest ones, I think, is that there was a security fix. Michael, can you tell us about that a little bit?

Michael Dyrynda: [00:18:30] Yes. The big part of the release was the security fix, which was to patch up a vulnerability in Laravel 5.4 that allowed phishing attempts on your application. Previously, using the password reset system, a malicious user could attempt to trick the users into entering their login credentials into a different application that they control, basically because the password reset notification would use the host of the incoming request and the host, of course, is something that you can forge using incoming [00:19:00] HTTP headers, or it can be spoofed easily enough. If a user didn't notice that after they clicked a link in this email that it went through a different application, they might accidentally enter their credentials into that malicious application. This was fixed. It's also been backported into Laravel 5.1 under the LTS support agreement. So 5.1 and 5.4 will have this sorted out as well.

Jacob Bennett: Very cool. There was a couple other ones I think we wanted to talk about. One of them maybe you can mention real [00:19:30] quick is the make method that was added to the Eloquent query builder. Could you kind of talk about that real quick and give us an example of maybe where you'd want to use that?

Michael Dyrynda: Yeah, so [inaudible 00:19:38] was talking on Twitter a bit and on a podcast that he runs with Daniel [Colburn 00:19:45], the benefits of having a make method on the Eloquent models. This is a lot like the create method except that when you call make, it's basically a wrapper for running a new. So instead of doing new post [00:20:00] and then passing in your array parameters, you would do post make, and then pass in the array of parameters, which you would think is not particularly useful on the surface, however, when you have to new, for example, a related model in a has many relationship, you would traditionally do something like author post save, and then you would go new post, and then pass all the parameters in there, so in that instance, it's a little bit more useful and a little bit nicer to read if you had post make in there, rather [00:20:30] than that new post. So this one's coming or is already available in Laravel 5.4.22.

Jacob Bennett: Yeah, I'm looking forward to using this. There was a couple places. I have one spot in specific I know that in my controller I have a comment that says, "To do, clean up this mess of a set of relationships that has to be put onto a model." And I think there's like two or three different relationships that are bound to this one particular one, and so it's nasty. This is gonna make it ... This is exactly what I needed. So, [00:21:00] yeah, looking forward to using this.

The other one that we had talked about a little bit before the show was the Eloquent find method, which, if you've used it before, you might have User::find(1) and you would find that specific user. If you wanted to ever pull back more than one user, let's say you wanted to pull back users where their IDs were one, three, and five, you might do something like User::wherein('user_id') and then pass the array {1, 3, 5}. [00:21:30] Well, basically, what has been pushed into 5.4.22 is the ability to pass any arrayable into that find method and get a returned collection from Eloquent. You would say User::find and then you could pass in an array of {1, 3, 5} or whatever, just a little short array syntax there, and it would return you a collection of those three users. So, it just saves you a couple keystrokes. It's a little bit nicer, and that is available now. So, cool.

Michael Dyrynda: Yeah. Well, I think that [00:22:00] is pretty much all we had this week, Jake.

Jacob Bennett: Yeah, I think it is. So light news week, but that's okay, and I am going to give you the responsibility, Mr. Dyrynda, of signing us out of this episode number 38.

Michael Dyrynda: Yeah okay. So, yeah, this is Laravel News Podcast, Episode number 38. If you would like show notes for this episode, you can find them at If you could like, rate, and review the show on iTunes, [00:22:30] five stars, or your podcatcher of choice, that would be much appreciated. If you have any questions for us, you can reach us at Laravel News on Twitter or via our personal Twitter accounts. I think that is everything.

Jacob Bennett: Spot on, my friend. Spot on. Well done. All right, everybody. We will see you in two weeks. Thanks for listening.

Michael Dyrynda: And don't think that I forgot about my foreign goodbye this week. Schlick is, I believe, a name of German origin, so [00:23:00] [nice seeing you on 00:23:00] this week. Auf Wiedersehen.

Jacob Bennett: Auf Wiedersehen.

Michael Dyrynda: What was it specifically that-

Tom Schlick: It's something that I've-

Michael Dyrynda: Drew you to ...

Tom Schlick: Sorry, the audio's [crosstalk 00:23:26]

Jacob Bennett: Yeah, it's cutting out a little bit. [crosstalk 00:23:28]

Tom Schlick: I can turn off my [00:23:30] video if that helps.

Jacob Bennett: Yeah, you just dropped out. Oh crap. I wonder if his Xbox is updating, that happens sometimes. Isn't that funny? I wish I was lying right now. I'm not. I'm speaking total truth. We'll be recording something, and he'll be like, "Oh my gosh. Of course my Xbox decides to update right now." It's like in the middle of podcast and it's so funny. There he is. Let's see if his Xbox cut out, hold on. I can't wait to [00:24:00] ask him this. Better include this.

Tom Schlick: That's fantastic.

Jacob Bennett: He always does outtakes at the end. I'm gonna ask him to put this in the end, about Michael's Xbox kicking his Internet connection. Was it your Xbox, Michael? It must still be updating. He's not moving on his screen. I'm gonna take this chance to eat a chip here. I've never had these before. I found them in our cafeteria. Oh my gosh. They're delicious. [00:24:30] All right. Michael, do you need us to turn off our videos? ... I can hear him. Can you hear us, Michael? Can you say anything? Ground control to major Michael.

Michael Dyrynda: [00:25:00] I've returned.

Jacob Bennett: Nothing.

Michael Dyrynda: I'm back. I'm back. I'm back.

Jacob Bennett: There he is.

Tom Schlick: There he is.

Michael Dyrynda: There was no-

Jacob Bennett: Do you need us to turn off our videos?

Michael Dyrynda: I don't think so. There was no warning there.

Jacob Bennett: Is your Xbox updating?

Michael Dyrynda: No, I checked.

Jacob Bennett: Your audio was really shoddy and then it dropped.

Michael Dyrynda: Yeah, there was no indication that that was gonna happen. Hangouts just said, "Your connection is gone now." And then that was it.

Jacob Bennett: Oh. Yeah I [00:25:30] was wondering if your audio was dying because of the Xbox or something.

Michael Dyrynda: Yeah, no, I'm watching that to make sure nothing is downloading, but it's just this video call.

Jacob Bennett: Okay. You were gonna ask a question before you got booted, so I'll let you pick up there if you want.

Michael Dyrynda: Yes.

Jacob Bennett: Do you remember what it was?

Michael Dyrynda: I do.

Jacob Bennett: It was about multi-tenancy.

Michael Dyrynda: Yeah, yeah, yeah.

Laravel News Partners


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