Latest / North Meets South Web Podcast / Controllers and Middleware, Grok vs. Claude, and Developer Value
Transcript
- 0:00-Hey. I'm Michael Dyrynda. -And I'm Jake Bennett.
- 0:03And welcome to episode 183 of the North Meet South Web Podcast.
- 0:10Hello, friends. It is once again that time of the week. It is Monday
- 0:16night, and, uh, it's dark out. And it's been dark for, like, the last five
- 0:23hours. I'm not digging this thing. And the thing is, I know it's gonna get even
- 0:27worse because
- 0:29shortly they're gonna change the time to be an hour... It's gonna start getting
- 0:33-dark at, like, 4:00 instead of 5:00. -Mm-hmm.
- 0:35Oh, I just hate this time of year. No fun, dude. No fun.
- 0:40-Are you- -And y-
- 0:41Are you getting rid of daylight savings? Is that what's happening?
- 0:44-Uh, you know what, man? -Or is that still-
- 0:45I feel like they've been put... I feel like they've been teasing us with this for
- 0:48-forever. -Right. Yeah, yeah.
- 0:49I really wish they would, uh, but I don't know if they are. I don't know. I feel
- 0:52like last year was like, "This is the last year they're gonna do it." And then it
- 0:56was like, "Ah, psych," or something. I don't know. We'll find out.
- 0:59-Yeah, okay. -We'll find out soon enough.
- 1:01-Find out when it happens -But I don't know.
- 1:02So I guess we... Not this weekend, next weekend, daylight saving starts here. So
- 1:07we're, you know, the day is already getting longer. It's bright when you wake
- 1:10-up. -Yup, yup.
- 1:10It's bright longer into the evening. So it's
- 1:13good for us because, you know, obviously it means you can get up a bit earlier and
- 1:17-there is some sunlight. -Yeah.
- 1:18And you finish work at the end of the day, and there is still sunlight, so.
- 1:22-Absolutely. Great. -But it has been, has been raining, which
- 1:24is, has made it difficult. Last episode we talked about my adventures with, uh-
- 1:29-Hay fever -... LawnHub. And well, hay fever, yes, but
- 1:32-LawnHub. -Mm-hmm.
- 1:32And I had to, had to go out and spray the weeds. And it says you're not supposed to
- 1:38do that if there's going to be rain within four hours. And when-
- 1:42-Ah -... I'm planning this ten days in advance,
- 1:44it's very hard to tell if there's going to be rain.
- 1:46-It is. Yes. -Because even if they can predict ten days
- 1:48-in advance, it's never correct. -Not n- Yeah, exactly. Exactly.
- 1:52So, you know, I, I got up on that day, and I look outside, and I'm like, "It doesn't
- 1:55look like it's gonna rain." And then I went for a, a run in the morning, or I
- 1:58went for a walk in the morning, and, and I got rained on. And I thought, "Okay,
- 2:03well, this has not bode well." And then I, I waited a bit and there was no rain. And
- 2:09I, I checked the, the forecast, and it said there's no rain due until, you know,
- 2:12three o'clock in the afternoon. This is 10:00 in the morning. I'm like, "Okay, I'm
- 2:15gonna go out, and I'll spray the weeds now." And I got almost finished, and it
- 2:20-started raining. -Ah.
- 2:22-You know, 30 minutes later, I'm like- -Oh my gosh. Pointless.
- 2:24-Come on. -I just wasted all that stuff.
- 2:26-Come on. -Yeah.
- 2:27But, uh, it, it seems to have worked though, 'cause I went out the next day and
- 2:30all of the, the weeds that I had sprayed had started-
- 2:32Yeah, but it'll still be at least, like, partially effective
- 2:33-... drooping and stuff, so. -Yeah. Yeah, it'll be fine. It'll be fine.
- 2:36So yeah, the next one is in, in 14 days when I have to go out and spray the actual
- 2:39fertilizer on the lawn, will be interesting. So I'm gonna, I'm gonna see
- 2:43if I can go and hire a dethatcher or a scarifier-
- 2:46-Oh, yeah -... whatever you call it-
- 2:47-Yeah, sure. Mm-hmm -... to go and, like, pull up all of the,
- 2:50the deadness from the surface of the, of the-
- 2:53-Yep -... lawn before I then go and put down the
- 2:55fertilizer. And, and hopefully that will help to rejuvenate it. So-
- 2:57Are you gonna, are you gonna aerate the soil too? You gonna pile out, pull out the
- 3:01-plugs and all that stuff? -Mm-mm. No, I'm probably-
- 3:02Dude, you're gonna become one of those lawn guys?
- 3:04No, I'm probably not gonna go that far. The scarifier I would do because it's,
- 3:08like, you know, a machine that you can hire that goes through and does it.
- 3:11-Yep, yep. -But anything that involves too much manual
- 3:13labor is something that I'm not that interested in, so.
- 3:15-Mm-hmm. -I have... Like, if, as long as I fertilize
- 3:18the lawn, it tends to come up okay. It's when it starts to get cold and wet, and I
- 3:22go, "I'm not gonna go out there and mow the lawn," 'cause it just turns to mush,
- 3:25-right? -Yeah. Yeah, absolutely. Uh-huh.
- 3:26And so, you do that once, and then before you know it, the weeds grow, you know-
- 3:30-Yep, yep, yep -... as high as your knees. And then you go
- 3:31and, and then you've gotta go and mow it, like, four times just to get it down to
- 3:34level. And by that point, it's too late, and it's just turned into weeds. So
- 3:40-I'm hoping it should be okay. -Hey, speaking of Scarify,
- 3:42speaking of Scarify, Halloween is around the corner.
- 3:45Yeah.
- 3:46-We're transitioning- -Do you guys do Hallow-
- 3:48-No -Do you guys do Halloween? Do you guys do
- 3:49-Halloween? -No, although we've been invited to a, a
- 3:51-Halloween birthday party, which I'm- -Oh, that sounds fun.
- 3:55Yeah. So
- 3:56for, for, uh... How old is he? Uh, uh, uh-
- 4:00-Nine. -I can't remember if this is the older
- 4:02-child or the younger child. -Eli's hanging out with the older kids
- 4:04these days. He's moving on up.
- 4:06Yeah. Yeah, he certainly is. Yeah. I am... It occurred to me that we were, we... One
- 4:10of the kids from school that lives, like, two doors down, he's in the, the year
- 4:14above Eli. And, um,
- 4:17we went around... With, with them, we went to the park. We had, like, a kick of the,
- 4:21the soccer ball, we played a bit of basketball, we pushed some kids on the
- 4:24swings. It was, it was a good bit of fun. But one of the other kids was there, plays
- 4:27in Eli's soccer team. And I was trying to put two and two together, like, how, how
- 4:32is this child friends with the older kid when he plays in Eli's soccer team?
- 4:36-Yeah, sure. -And it took me a while to realize that he
- 4:38is actually an older kid
- 4:39-playing- -Ah, okay
- 4:40... down a grade in soccer. So he is in, in the older kids' year level, so.
- 4:45-That's fun. -But, uh-
- 4:46-Yeah. -You know, they played, they played
- 4:47together for two terms before I realized this.
- 4:51-That's fun. -So-
- 4:52Yeah, no. It's good, probably good for Eli to play up with, like, a little bit older
- 4:55-kids and stuff. -Mm-hmm.
- 4:57And yeah, I'm sure he gets... You know, it's like you play to the level of your
- 4:59competition or of your teammates, I suppose.
- 5:01-It's, uh, yeah. -And so you probably get better as you
- 5:03play. Yeah. So we, um... Harrison had a soccer game this last Saturday and scored
- 5:07two goals. He was practicing his hat trick dance if he got three goals.
- 5:11-Ah, yes. If he gets three, yeah. -And so he, yeah, he had it all planned
- 5:12out. Oh, he was... He wanted it so bad. He had a couple, like... He got two goals
- 5:17-and then he- -Mm-hmm
- 5:19... kicked a third. It was high, it had a lot of, like, spin on it. Like, hit right
- 5:22in front of the goal and bounced backwards.
- 5:23-Yeah. -Like, uh, did not go into the goal. Yeah.
- 5:25-Then he had a couple of those. Anyway- -Good.
- 5:27It was fun. He almost made it. It was, it was the last game of the season, so it was
- 5:30-like his last chance- -Mm-hmm
- 5:31... to get it. But no, it was, it was all fun. All fun. Um, yeah. Okay. I've... You
- 5:37know, when we started this, this show we're like, "What should we talk about?"
- 5:39Well, I've got a couple things. First of all, um, have you ever seen these 1Up
- 5:44Arcade boxes? So, like, they're, like, not a full arcade cabinet, but, like, it's,
- 5:50th- they're like mini arcade cabinets, if you will. So, like, 1Up Arcade, Street
- 5:55Fighter, they've got whatever. So David Hemphill and I are big into Street
- 5:58Fighter. We played, uh, Street Fighter when we were at Lari: Con this year. That
- 6:01-was fun. Um- -Mm-hmm.
- 6:03But I always wanted a little Street Fighter box. And so I found one on
- 6:07Facebook Marketplace, this guy was selling it for, like, 100 bucks. I'm like, "Why
- 6:09is he selling it for ch- so cheap?" Well, turns out he was trying to convert it to,
- 6:12like, a RetroPie.Which is like a Raspberry Pi with, like, the software...
- 6:17-Mm-hmm -... installed on it that allows you to
- 6:18download ROMs and then use all the stuff. So he had done all the conversion on it.
- 6:21Like, where you have to swap out all the buttons, you have to buy this, like, LCD,
- 6:25um, converter that will hook it up to the port. He bought all the parts, had done
- 6:29all the things, and could not get the last step. Could not get it to work, just
- 6:33didn't have the chops,
- 6:35and so... Or so I thought. And so I was like, "Well..."
- 6:38-Mm-hmm. -"...I'll figure this out, no big deal."
- 6:40Well, no, it's been sitting in my basement for two months and I have not been able
- 6:43to get it to work. And then I rewatched a couple tutorials and realized there was a
- 6:47ribbon cable that was flipped around the opposite way.
- 6:50-Wow. -Turned it around, plugged it in. That was
- 6:51it, dude, I was, I was off and running. And so that's been so fun, been playing
- 6:55-with that, like- -It's wild they did something so simple.
- 6:57-Oh, seriously. I mean, it's just- -But yeah, I suppose if you, if you flip
- 6:59-the pins, then it's, uh... -Yes.
- 7:01But, uh, you know, this is why, uh, PC cases have always had the little notch so
- 7:05that you could never get it the other way around.
- 7:07-Yes. Yep, not this- -Because you don't wanna s-
- 7:08-... not this one. -You don't wanna r- yeah, you don't wanna
- 7:10-reverse, uh- -Yeah, polarity order, yeah
- 7:13... electricity going to the motherboard, huh?
- 7:14Exactly. And so anyway, dude, that's been so fun, and it's a really fun little,
- 7:18like, hobby project. Now, the cool thing is, like-
- 7:20-Mm-hmm -... I didn't have to pay $400 for it. I
- 7:21paid, like, 100 bucks for it, and then half was already bought.
- 7:24-Yeah, it's pretty good. -So yeah, it's, it's been a little, it's
- 7:25been a lot of fun just playing around with that. Me and Harrison played some Street
- 7:28Fighter today, and we both like that game, and so... Yeah, that's been pretty cool,
- 7:32so I would suggest that as a fun little hobby to anybody if they're interested.
- 7:35There's, uh, there's some cool little mods you can do out there with it and it's,
- 7:38-it's pretty fun, so that's been cool. -All right.
- 7:40-Um, yeah. -I can, we can buy these things here, uh-
- 7:43-Nice, yeah -... Mortal Kombat, Mortal Kombat Deluxe...
- 7:45Yes.
- 7:45Arcade machine has 14 games, Mortal Kombat 1,
- 7:482, 3. There's some other Mortal Kombat and a few other random games on there,
- 7:55-thousand bucks, plus delivery. -Yeah.
- 7:59-All right, good times. -Yeah. Yep. So this is almost... Yeah
- 8:02-Lose that before I spend money. -The- the pri- yeah, exactly. The price was
- 8:04right. Like, it was, it was way cheap, and I was...
- 8:06-Mm-hmm. -"Yeah, I'll try this out." So that's been,
- 8:07-that's been kind of fun... -Yeah
- 8:08... to just mess around with but, and finally got it working.
- 8:10-Love it. -Um, the other thing that I wanted to talk
- 8:13about though is
- 8:15we've talked a lot about the permissions stuff, right?
- 8:18-Mm-hmm. -And so I- I wanna, I wanna sorta share the
- 8:20saga with you, if I can. Um,
- 8:24so we talked originally about how we went through all of our applications, and
- 8:27previously we only had roles, and we replaced any place where we are checking a
- 8:32role with a named permission. So instead of saying has role admin or has role
- 8:38manager, we would say, "Nope, what are we trying to do in this place? Oh, we're
- 8:41trying to edit a blog post. Okay, so we're gonna replace that with a check to say
- 8:46permission enum
- 8:47-edit blog post." Right? -Mm-hmm.
- 8:49-That's- that's what it was. Um- -Yeah
- 8:51... and then we used attributes to associate active directory group, security
- 8:56group names with those permissions, and then in active directory we just set those
- 8:59permissions, or we set those groups, those security groups on the particular
- 9:03users that need those things. It works great. Works really, really well.
- 9:05-Yeah. -It's pretty cool.
- 9:06-I think. -We've had some other interesting solutions
- 9:08around that. Okay, that's the, that's that side of it.
- 9:12Um, now, the question has been, where do we do those permission checks? And all
- 9:16we're doing with those permission checks is we're just doing gates, right? We're
- 9:19-setting up gates... -Yeah
- 9:20... um, so that you can use Laravel's default can. You have can middleware, you
- 9:24-have a can directive, you have... -Mm-hmm.
- 9:27You know, this authorize that you can use inside of the controller if your
- 9:30controllers are auth- y- you know, using the authorizable trait. Um, you can do it
- 9:35inside of a form request, you can do it, you know, a bunch of different places.
- 9:39-Yeah. -Um, you can, uh,
- 9:41you know, you could just use the gate facade. There's all sorts of ways that you
- 9:44can do this, right? And so the way that we had previously done it, like, as our
- 9:48first step is we just replaced any of the middleware checks, um, in our routes file
- 9:53with can middleware checks, and, uh, I mean, totally fine.
- 9:57But that sort of broke down a little bit. Um, we ended up having to, like, rearrange
- 10:01-how our routes files were set up, and... -Yeah.
- 10:04... you'd end up having to, like, break apart different pieces, um, based on-
- 10:09-Just to get the granularity. -Exactly. And so, like, you'd have a route
- 10:12file that would belong with another one, like, co-located with it that would have
- 10:15to be, like, further down, and then ended up being like, there'd be a merge conflict
- 10:19and somebody, like, fixed the merge conflict but they accidentally moved one
- 10:22-out of that group. -Yeah, yeah.
- 10:23And so now it was without permissions because, you know, it's just, like, in the
- 10:26-routes file, and so- -Yeah
- 10:28... I was like, "We can't do that anymore." Um...
- 10:30-Mm-hmm. -We- we've gotta... It- it just did not
- 10:32feel like it was close enough to the metal. It just felt like it was so s- sort
- 10:36-of, like, out there and removed. -Yeah. Yeah.
- 10:38Um,
- 10:39and so, um, so first off, like, do you identify with that at all? Like, do you
- 10:43feel that? Like, do you ever feel like if you're doing a- a middleware check or a
- 10:46can check out at the edge there on the routes file, does that ever make you feel
- 10:50a little bit like, "Eh, feels a little too fragile"?
- 10:53I don't know off the top of my head anywhere where we are doing
- 10:58an authorization check in our routes file.
- 11:00-Okay. -Like, maybe very high level, but- but
- 11:02-nothing granular. I think all of that- -Sure
- 11:05-... granularity... -Like, are... yeah. Sure, like-
- 11:07... all those authorization checks will push down into a form request or into,
- 11:10like, an action class if we wanna enforce that behavior deep into the- the business
- 11:14rules of that behavior.
- 11:17But- but typically, it'll be in- in the authorize method of a
- 11:21form request or inside of, like, an a-
- 11:25an action class,
- 11:26-somewhere where we're authorizing that. -Okay. So that l- that brought me to my
- 11:31next step, which was, okay, so if we're not gonna do it in the middleware, we
- 11:34have, uh, we can- we can do it inside of each controller, uh, method.
- 11:38-Mm-hmm. Mm-hmm. -Right? So if we're using resourceful
- 11:40controllers, um, we can just do a
- 11:43-this authorize, um... -Yeah
- 11:46... or request authorize or whatever it is, this authorize, and that's gonna pass
- 11:49in the user, and then you can just pass in the permissions check, which is fine.
- 11:52That- that works great. But
- 11:54it's, like, I sort of hate having to have those at the top of every controller
- 11:58method. It sorta sucks. And so you have some options, right? Um, one option that
- 12:04was really interesting and attractive to me was that if you're dealing with a
- 12:08resource, like a blog post, for example, instead of having to put that in every
- 12:14single method...Um, this gate check, this authorize check, in the constructor you
- 12:19could say, "This authorize resource," and then you could point it at the policy that
- 12:25you had created, if you created a policy, like a post policy.
- 12:29-Mm-hmm. -And then you could do your, your gate
- 12:30checks in there. So inside of that, you could just kind of say, you know, um,
- 12:36"Here are the different a- view any, view, edit, update, whatever."
- 12:39-Mm-hmm. -And you would just say, "Authorize
- 12:41resource, here's the policy," and it would automatically apply the correct policy
- 12:45check to the proper method, which was amazing.
- 12:48-Yeah. -I was like, "This is great." Okay, so
- 12:49we're gonna move everything to policies now.
- 12:52-Mm-hmm. -Everything to policies, and then we'll do
- 12:54our, you know, our permission checks inside of those policies so we know like,
- 12:58okay, you go to the controller, the controller's gonna have an authorize
- 13:00resource. And then at the top you're gonna click through that, and that's gonna get
- 13:03you to your policy. And the policy is gonna define the, the different, you know,
- 13:07permissions that they need in order to be able to do these things. Very well
- 13:09organized, very clean, super nice, loved it.
- 13:12-Yeah. -And then Laravel 12 came along.
- 13:16And Laravel 12 basically nukes all of that.
- 13:18-Mm-hmm. -It does not use the authorize resource
- 13:20anymore, it is not in the docs anymore, and
- 13:24now it's back to, and all the docs recommend using
- 13:28Gate.dodop.authorize inside of every controller method.
- 13:34-Mm-hmm. -And I'm just like, "I hate this.
- 13:36I really-" "...hate how it looks." And so I know-
- 13:38-Mm-hmm -...what you're saying is you just use a
- 13:41-form request in that case, right? -Yeah.
- 13:43If you want to, if you want to do that authorization check, you're just gonna
- 13:47say, "I am, I am going to do that inside of a form request
- 13:51for every method inside of all those controllers," right?
- 13:56-Yeah. -Um, is that accurate? Is that how you
- 13:57-would do it? -Yeah. And we, we also typically use a lot
- 14:02-of single action controllers because- -Mm-hmm
- 14:04...we are not, like we're not building a crud, cruddy app really. Um-
- 14:10-Yeah -...we have lots of components, and
- 14:12components make requests to specific routes.
- 14:16-Endpoints, yeah, sure. -Endpoints that are responsible for doing
- 14:20particular things. So yeah, we, we will typically have an action that is called,
- 14:25uh, from a controller that is, um,
- 14:29past a, a request object which is responsible for doing the authorization.
- 14:34And whether, you know, whether it's a, a get endpoint or an index endpoint where
- 14:39like, some things don't need to be authorized, and so the authorize method of
- 14:44-that form request will just return true. -Yeah, sure.
- 14:47But there will be some index methods where we do need to do tho- those checks in
- 14:51there. And so we will do the authorization inside of, you know, a otherwise empty
- 14:56form request. But it gives us, you know, extra files around the place, but they are
- 15:01consistently named and consistently located. So if we have like a, a
- 15:08user index controller, for example, then we would also have a user index request
- 15:14that goes in, you know, the, the request folder or whatever. But if you are using
- 15:17your fuzzy, fuzzy finder in your editor, you're going to type, you know, user index
- 15:22and you will see the request and the controller there, uh, next to each other.
- 15:25So it's easy enough to find 'em. And then you'll also have the user index action
- 15:28perhaps. Um, and so all of this stuff, because it's, it's got like a
- 15:32s- a common prefix, it all comes up when you're searching for it. Um,
- 15:39your mileage may vary depending on whether or not you'll, you're navigating the file
- 15:42-tree or if you're using fuzzy find. Um- -Sure, sure
- 15:45...you know, obviously as a VIM user, my hand's on the keyboard so, uh-
- 15:49-Yeah, yeah -...it's, it's more common that I will find
- 15:52things that way. Um, and that also then extends to tests, like if you've got a
- 15:56user index test, for example, um, or a user index controller test, whatever you
- 16:01wanna call it, all of these things will appear, you know, at the top of your
- 16:05search anyway. So
- 16:06it makes it easier from that perspective to locate things rather than having to
- 16:10traverse the directory tree to look in like a request folder or a controllers
- 16:13folder or wherever else. It's all just there. Um, so yeah, more files but
- 16:19they're, they're typically very small files,
- 16:22but it also then allows us to co-locate that behavior where it makes the most
- 16:25-sense. You know, requests- -Yeah
- 16:27...and authorization kind of go together. Controllers are really
- 16:31just for delegating, you know, taking some data, passing it to some action and
- 16:35returning some response. But they're, they're typically, you know, no more than
- 16:39five or six lines long.
- 16:41Right. Yeah, and I think, I think for me, I get it, like I get... I'm not
- 16:46necessarily so concerned with
- 16:49making a new form request for every single thing, although it does sort of suck,
- 16:53honestly. Um, and I think it's just because it's like, how many levels of
- 16:56indirection do I have to have before I finally get down to the thing? You know
- 16:59-what I mean? -Mm-hmm.
- 17:00'Cause it's like the reason we organized it around policies is because we were
- 17:03like, "Okay great, we're gonna treat them as resources." Okay, so now we have
- 17:06-policies. -Mm-hmm.
- 17:06Wonderful. But now it's like we're sort of saying, well, I mean maybe it's a policy
- 17:10but we're basically gonna have a form request for every single one of them
- 17:13every, anyway, so what's the point of having the policy?
- 17:16-Mm-hmm. -Like, now the pol- so, so now I go
- 17:19route controller, method, form request, authorize, policy, then permission?
- 17:25-Mm-hmm. -I mean, holy crap.
- 17:25-Mm-hmm. -That's like seven layers of indirection to
- 17:27-get down to the actual- -Yeah
- 17:28...permission check. It's crazy. And so it's like, if you're gonna do that, if
- 17:32you're going to do a form request, it almost feels like you could do without the
- 17:36-policy, um, because- -Mm-hmm
- 17:39...like, I don't really, I'm not using it almost anywhere else-
- 17:42-Yeah -...except for in the controller. And so-
- 17:44-Yeah -...you know, if I'm going to create the
- 17:46form requests, I almost don't wanna create the policies because-
- 17:50-Yeah -...I don't wanna do one more layer.
- 17:54Yeah. It also depends. Like if you're very
- 17:57resource-centric as it seems to be that you are, then, you know, the policies-
- 18:01-I mean, sometimes it's- -...do make sense. But we, we definitely
- 18:05err on the side of
- 18:07not having resources. Like we're not updating people and businesses and
- 18:12addresses and things like that as commonly as we are adding a person to application
- 18:17or add address to person or, you know, all of this kind of stuff where these actions
- 18:22kind of dictate what's happening.So, um, and so whether or not you have access to
- 18:26do that action is kind of decoupled from the resource itself. Whereas
- 18:33you, because you've got the policies and that kinda stuff, you're- you're more
- 18:37leaning towards that side of things,
- 18:40so it probably makes more sense to use the policies. Um, but I still think, you
- 18:45know, the form requests just make a- a consistent... Yeah. Yeah, it's seven
- 18:49layers and it's more things, et cetera, but it's always gonna be in the same
- 18:54place. You don't have to stop and think, "Oh, hang on. This is an index method.
- 18:58Where do I authorize this now?" No, it just goes in the form request.
- 19:01-Yeah. -Like-
- 19:02-Mm-hmm -... yes, extra file, yes, extra location.
- 19:05Potentially, like, if you're doing the policy and, you know... But it, but it
- 19:10means that you can guard those things directly as well, using the policies.
- 19:15Yeah.
- 19:15-Um, where- -I guess that's-
- 19:16... you're not necessarily encapsulating business logic behind
- 19:19-a request or an action or whatever else. -Yeah. Okay, so here's the last piece with
- 19:24the form request thing. So, like, there will be... So there are places where we do
- 19:28have more intensive sort of policy logic. So for example-
- 19:31-Mm-hmm -... I'll have, like, a coaching entry,
- 19:34right?
- 19:35And for that, a coaching... And, like, if somebody... The ability to be able to view
- 19:40a coaching entry depends on if it is... Like, if the person that's logged
- 19:46in, if their user ID is the person that is, like... They're the coachable team
- 19:52-member ID- -Mm-hmm
- 19:53-... or something like that, right? -Mm-hmm.
- 19:54They're the person who's being coached. So if it belongs to them, they can see it.
- 19:57Or if it is a person who directly manages them. So if they're anywhere within... So
- 20:03indirectly or directly manages them. So if they're anywhere in the tree of that
- 20:06-person's- -Mm-hmm
- 20:07... purview, they can be seen, right? Where does that live? That has to live
- 20:10inside the policy. That's the logical place for it to live.
- 20:12-Mm-hmm. -My question is,
- 20:14if I'm doing that, um, does the... So, like, let's say the, uh, the view
- 20:21coaching entry request, right? Or is it coaching entry view request? Which one is
- 20:26it? Coaching entry show request? Is that what you'd call it?
- 20:30Yeah, it's show coaching entry request, I think.
- 20:33-Okay. So verb and then model and then- -Mm-hmm. Mm-hmm. Yeah
- 20:37-... yeah? Okay. -Yeah.
- 20:38So show coa- so show coaching entry request. If I do that, um-
- 20:43-Mm-hmm -... does the show coaching entry request
- 20:44authorize the method, have access to the ID or to the currently hydrated, eager
- 20:49loaded, um, model binding, right? Does that make sense?
- 20:55Uh, like, yeah, for the, like, for the relate, for the related entry.
- 20:59Right. So, like, so when you do, you know, you have implicit route model binding,
- 21:02-right? -Mm-hmm.
- 21:02So, like, it will, it will automatically pull the ID. You know, it says, "Here's
- 21:07-the ID." -Yep.
- 21:08Uh, "I'm going to go ahead and grab that particular type hinted model out of the
- 21:13-database," or "I'm gonna 404." -Mm-hmm.
- 21:16And then you use that in the policy to then check against, is this current, you
- 21:21know, is this current, uh, coaching entry? You know, you inspect it, basically, to
- 21:25determine if the person who's currently logged in can see that thing or not.
- 21:29-Yeah. -So my question is, does the authorize
- 21:31method have access to that particular model? So that when I'm saying, uh, this
- 21:36arrow authorize post class, comma, or- or just say, like, view, comma, and then I
- 21:43-pass in that particular post. -Yeah. Well, the- the route model binding
- 21:49stuff is done
- 21:51up the stack and then passed down into the request. So you do have access to the
- 21:55route and all of its bound parameters at that point. Yeah.
- 22:00So, yeah, like, in the controller, typically you have, like, the way that the
- 22:03implicit route model binding works is in the controller you have request, you know,
- 22:07type entered request, dollar sign request, comma-
- 22:10-Mm-hmm -... type entered coaching entry, dollar
- 22:12-sign coaching entry. -Mm-hmm. Yeah.
- 22:13-Right? -Yeah, yep.
- 22:14And then in the controller, you have access to that thing. So what I'm saying
- 22:17is I don't know how to get access to the coaching entry, dollar sign coaching
- 22:21entry, from the authorize method, 'cause I would need that-
- 22:23-Yeah, and- -... in order to be able to do my policy
- 22:25check.
- 22:26Yes. La- uh, so typ- previously, you'd have to do, like, this route and then pass
- 22:31-it the, the string name. -Mm-hmm.
- 22:33I think in Laravel 12, they introduced the thing so you can use an attribute to then
- 22:38bind that directly out of the route. So you can... I think it's pound square
- 22:44bracket route, and then give it the thing, and then you can actually inject a
- 22:48properly typed, um,
- 22:51class or instance there so that you will get the completion and you'll get all of
- 22:55that stuff there, and Laravel will then handle injecting that from the request
- 22:59-automatically. From- from the route- -Because doesn't that feel like... So if
- 23:02I'm just, I- I'm- I'm discovering the solution here with you. I'm talking it
- 23:06-through- -Mm-hmm
- 23:06... because I'm interested in- in how it kinda does work. To me, it feels a little
- 23:09bit gross that, like, I have it type entered inside the controller. Like, and I
- 23:13know the name of it, I know the variable and all that stuff, but the form request
- 23:16-does not have that. -Mm-hmm.
- 23:18You know, it doesn't know. It doesn't have any idea of that route model binding
- 23:22thing. It doesn't know. And so
- 23:25it's like I have to either, you know, duplicate that inside of the form request
- 23:31or I have to somehow pass it in. I just, like, I'm wondering, you know, what is
- 23:35Team Laravel doing for this? Like, it seems like this is not
- 23:41how I- I would think that it would be done. Like, it just-
- 23:44-Yeah -... it seems too chaotic. I just, I'm
- 23:47like, "Who..." There- there's gotta be a way. There... Either there's, A, they're
- 23:50doing it a certain way that they're not super stoked with, um, and they're just
- 23:55sort of doing it. Or, B, they're doing it a different way that I'm completely
- 23:59unaware of. Or,
- 24:01C, I just don't like it and they don't give a crap. They don't care at all.
- 24:04-Mm-hmm. -It's fine. It's fine for them. You know
- 24:06-what I mean? -Yeah. Nuno, I think Nuno was posting
- 24:10something about this the other day. I saw a screenshot. So they're just calling
- 24:15request validate, um... Oh, no, this is the MCP Tools thing. I'm sure I saw that
- 24:21he tweeted somewhere.
- 24:24In Laravel MCP, tools, prompts, and resources share the same API request
- 24:28handle response. Similar to controllers in Laravel, you can validate input, dispatch
- 24:31actions, and more.But this is calling request validate, this is not talking
- 24:36about authorization.
- 24:38I'm, yeah, I'm, I'm certain in one of Nuno's, um, streams or videos that he
- 24:45posted, he did talk about how he goes through this. Which I assume would be very
- 24:49similar to how they're doing it, uh, in Laravel Cloud at the very least, 'cause he
- 24:53had a heavy hand in, in the architecture of that platform. So, um, it would
- 24:58definitely be good to, to gauge
- 25:01some... 'Cause I know that, you know, you brought this up in, uh, in Cash Money,
- 25:05-and, and David- -Yeah
- 25:06... David Hemphill and I, we've, we're very much aligned in this in terms of, um,
- 25:11you know, using form requests for everything, and, and handling
- 25:13-authorization that way, so... -So, so-
- 25:16-I think- -Like-
- 25:18... I think this is where it kinda comes down to, you know, there are many
- 25:20different ways of doing these things in Laravel, and it, and it varies case by
- 25:24case, app by app. Um, you know, some things make sense in some context that are
- 25:29different in others. Uh, and it's hard to find, like, the one prescribed way of
- 25:34-doing it. -Yeah.
- 25:35-Um, but yeah, I know- -I just, I just wanna be consistent, and it
- 25:38-just- -Yeah.
- 25:39Every time I feel like I've got it nailed down, there's, like, some weird edge case
- 25:43-thing that's like, "Oh-" -Mm-hmm.
- 25:44"... except for that, then you have to do it a different way." And I'm like, "No-"
- 25:46-Yeah. -"... dang it all, I don't wanna do it a
- 25:47-different way. I wanna do it-" -Yeah.
- 25:48"... the same way every time." Like, and it just feels like I can't find that way.
- 25:53I thought I had. I though- I did, I actually did have it. When I had that
- 25:56authorized resource thing, it was working perfectly. Now I, now it's, now I can't.
- 26:01-It's, it's- -Yeah, I mean, that's-
- 26:02-I'm screwed. -That's gone from
- 26:04the controller, because the base controller is gone, but you can still use
- 26:07the trait directly if you wanted to. You can, I mean, you can always bring that
- 26:10-base controller- -Well, no-
- 26:10-... back if you wanted to. -You can, but-
- 26:13-Or is it gone? -... you have to extend, like, if you do
- 26:16that, the, the, the way that they do the middle ware on the controllers is also
- 26:21-different now- -Right, okay
- 26:22... because they've, they've removed that construct middle ware.
- 26:25-Yeah, 'cause it's a method now. -Yeah, they've con- removed that. And so
- 26:28you have to have, like, there's like a public static function middle ware on
- 26:31every controller, but the authorized resource uses that middle ware the way
- 26:37that it was previously written. Which is why I think-
- 26:39-Mm-hmm -... they removed it from the docs. It was
- 26:40like, "No, we're not gonna do this anymore." Like, you have to extend-
- 26:43-Mm-hmm -... a different type of, um... I- I looked
- 26:47into it. It's just, you have to do something funky. It's definitely not the
- 26:49direction the framework was going. Which I'm fine with saying we're gonna stick
- 26:52with where the c- the framework was going. I'm fine with changing, I just don't feel
- 26:56like I have a clear picture of, like, how it is. And, and again-
- 26:59-Mm-hmm -... maybe it's... They are just like, "No,
- 27:02no, no, there is a clear picture. The clear picture is do a gate authorize check
- 27:06in every single controller method." And I'm just like, "Ick, I don't like that.
- 27:09-That's still the thing." Um- -Yeah.
- 27:12-And so, you know. -I found, I found Nuno's, uh, tweet about
- 27:15it. It was from the 29th of January. So some things just stick in my head better
- 27:18than others. But he said, "Yes, authorization on my form request. I
- 27:22typically test form request on my controller test." So the... I- I've linked
- 27:27it to you, I have a link for you in the show notes. Basically he's got a
- 27:29controller which has a method that injects the request, and the assumption is that
- 27:33the authorization has already happened in the request, and the validation obviously
- 27:36then happens in the, uh, form request implicitly. And then it's just a matter of
- 27:41calling the action handle method and returning response from the controller,
- 27:45-and- -Okay, so here's, here's my only, this is
- 27:47my only hang up, right? And you may have an answer to this, you may not.
- 27:52If I have
- 27:54a
- 27:56item.
- 27:58If I'm edit, like, so if I'm editing an item, okay?
- 28:01-Mm-hmm. Mm-hmm. -And I am getting that through the
- 28:03controller method, um, not store, not like a new one, like I'm-
- 28:09-Mm-hmm -... editing or I'm viewing one that
- 28:10-already exists. -Mm-hmm.
- 28:12How can I reference that item that's coming in in my form request
- 28:18in the authorize method? That's it. If I could figure that out, I feel like I'm
- 28:21good.
- 28:22And I'm, I want that to be actually a good answer. Like, I don't want it to be some
- 28:25janky, like, I have to pull it from the route thing. Like, I want it to, like...
- 28:29Yeah. Well this is the, the route parameter attribute that you would, you
- 28:32would
- 28:33hint that
- 28:34in that authorize method, and it should inject it for you that way.
- 28:39-Okay. -That's how I believe it's meant to work,
- 28:41so.
- 28:44Storage, keep that route parameter attribute. Yeah.
- 28:47Yeah. Yeah, and I'd say the only piece to me that still feels incomplete on that is
- 28:52that I have to have that in both my controller and my form request, that same
- 28:57variable. I have to keep it in. I have to keep it consistent. It, my refactor tools
- 29:02are not gonna know that those are gonna need to change together.
- 29:05No. They won't. Um,
- 29:10no.
- 29:12But you, you need... Well, yeah, you need to put them in both places anyway
- 29:17if you need both of them to be aware of it. It's, like, it's no different than
- 29:20passing it down into an action or sending it somewhere else. Like, those things just
- 29:24-need to know about it. -Well, except for from there, I'm passing
- 29:26-it from the controller into the action. -Mm-hmm. Mm-hmm.
- 29:30Right? And so I can see it in the controller. It's like it's right there.
- 29:33-Yeah, yeah. -I can see the name of the variable. I know
- 29:34I have that available to me in the controller.
- 29:37-Mm-hmm. -And so then I just... And it's no problem.
- 29:39-I- I just, it's like it's- -I mean, if you wanted to
- 29:42if you wanted to, you could then, you could then type the route parameter in
- 29:46both of them rather than relying on the implicit injection
- 29:51-into the controller. -Could I do, could I...
- 29:53-So rather than just- -Go ahead.
- 29:55Yeah, so rather than in your controller method doing, you know, binding the, the
- 29:59model directly, you could just say route parameter. 'Cause this, you can-
- 30:03-Ah, okay -... that route parameter attribute
- 30:06is, a- an attribute that targets parameters. So you could do it on a, on a
- 30:11controller's edit method, yeah.
- 30:14-Mm-hmm. -But, you know, without running the code,
- 30:16looking at it, it certainly seems to, to be the case.
- 30:21Okay. I need to find the documentation for that,
- 30:24for what you're talking about. Is it an attribute, that route attribute?
- 30:27Contextual, yeah, contextual, contextual attributes, I think is what they're called
- 30:31-in the documentation. -Okay. Let's look that up.
- 30:34Contextual attributes, yeah, as part of the service container documentation.
- 30:42Contextual attributes.
- 30:44Route parameter, and then so you say, like, the route parameter would be, uh,
- 30:49-coaching- -Yeah
- 30:51... as a string, and then you would have a, you know, coaching,
- 30:56dollar coaching, you know, and put it put it in the definition that way.
- 31:01I'm curious if when I get it that way, if it's actually going to give me is is it
- 31:06just going to give me the value, the ID that's being passed through? So I have to
- 31:10-look it up again? -It'll it'll do the casting for you.
- 31:12-It will do that. -It's basically an explicit model
- 31:16binding.
- 31:18Right? You're saying take this thing explicitly from the route, right, the the
- 31:25ID of the coaching
- 31:27model, and then Mhmm. It will handle casting that into a coaching
- 31:30-Oh, I see it -... model.
- 31:33Mhmm. Mhmm. Mhmm. Yep.
- 31:37And it does a container make from the request and gets that route parameter, and
- 31:42then you get that back because it's an attribute that you have now typed as a as
- 31:47a, method parameter, you'll get the type of that thing knowing that it is an
- 31:53instance of whatever it should be out of the route, which in this case
- 31:57Interesting. So I could do that I could do that inside of the, um,
- 32:02-the form request? -The form request and the controller. Yeah.
- 32:05I mean, it it doesn't stop the like, I've gotta put it in two places. But it makes
- 32:10-it -Yeah. Or maybe or maybe it actually I
- 32:12wonder if it actually also, makes 2 queries.
- 32:16-That would be the thing to check for. -Hmm.
- 32:20I mean, it's pulling it out of the route. So it's set
- 32:23-on the route there. -Yeah.
- 32:26-Yeah. -So
- 32:28worth exploring. Uh, I wouldn't go and refactor my
- 32:31I'm still not super yeah. Well so that's where we're at. It's like we're already
- 32:35going through the process of refactoring the code base. So I'm pulling my hair out
- 32:38trying to figure out, okay, we're doing this once. How do we wanna do it? And I
- 32:42just don't feel like I have a good answer. So
- 32:45-Yeah. There are -I might just end up I might just so what I
- 32:47know what I know I can do is the the easy way that's ugly is just do the gate
- 32:53authorize check at the top of every controller method and call it good. And it
- 32:56is it is ugly, but it's effective, and it works every time. Like
- 33:00-Yeah. -I mean, there are there are some ugly
- 33:03things, and there are some paper cuts in the framework that I don't know that there
- 33:07are good solutions for. Um,
- 33:10and, like, I know that Taylor likes to go through and find these paper cuts and and
- 33:14clean them up, but there are just some things that I think can't be cleaned up. I
- 33:19mean, I say that now, maybe in 6 months, he will, you know he will have one of
- 33:22those light bulb moments and figure out how to do it. But, um, yeah, the the form
- 33:28request and the controller kind of different context as well.
- 33:31-Yeah. Yeah. -Even though they're coupled. Um,
- 33:34-yeah. -Yep. Yep. Yep. Yep. Okay.
- 33:38Interesting. I'd be interested to to hear where you land on it though.
- 33:41Yeah. I think I think if I'm if I'm just trying to be, like if I'm trying to be as
- 33:47consistent and as, like, pragmatic as I would as I could be, I think, ideally, I
- 33:52would like to put it in the form request. I would like to just always have a form
- 33:55request object, always have an authorized method, and always be checking the policy
- 34:00-in that spot. -Yeah.
- 34:01Um, and then I think the trick the only trick I have to figure out is how I can
- 34:05make sure that I have access to that that, um, model that is bound, you know, the
- 34:11implicit binding. And if I can figure that out, then I'm I'm good to go. And I'll
- 34:14I'll let you know kinda where we where we land on that.
- 34:16-Yeah. Excellent. -Cool.
- 34:19-It's nice. -Okay. Yes. Yes. Yes. Alright. We are what
- 34:23-time are we at here? 34? -Yeah.
- 34:26Alright. We got we we got anything else before wanna talk about before we go or
- 34:29are we good?
- 34:31Uh, no. I mean, we talked about the Salesforce mocking thing, uh, last
- 34:35episode, which I'm still working my way through because I realized today that at
- 34:40some point during the AI writing the code, it deleted a whole bunch of code that I
- 34:45-Oh, fun. -... still had written. So and I'm not sure
- 34:47like, I don't know if I'd stashed it and then dropped the stash because I thought I
- 34:51wasn't working on that anymore. Um, but it likes to be very verbose. And so
- 34:56what I have found through this process
- 34:59is that
- 35:00a lot of stuff you end up doing multiple times because you'd like you get the first
- 35:03cut and then you have to like tidy it up and then it like starts doing weird
- 35:07things. Like I said, I want you to bind a faker instance to the container. So it
- 35:12went and actually bound
- 35:14well, I said I wanted to choose dependency and injection. And so I went and then
- 35:17bound an instance of faker to the container rather than just injecting it as
- 35:21a constructor
- 35:23property. So this is things like that. I'm I'm getting to the point where I'm, like,
- 35:28I would just do this myself. Like, you have given me enough of the skeleton that
- 35:32I can go and make the rest of this work. Otherwise, I'm just gonna keep going round
- 35:35and round in circles.
- 35:37So
- 35:38I did find though, um, I'm using I think we spoke about open code last time. I'm
- 35:43using that. They're offering brock code fast for free for a period of time while
- 35:50they're testing it out with with their stuff. And I think
- 35:54it tends to produce results, like, good enough results much quicker because it
- 35:59doesn't
- 36:00spit out all of the, like, thought process that it's going through where Claude
- 36:04and the Sonnet model will say, you know, I'm doing this. I'm looking at this. Oh,
- 36:09this didn't work. I'm gonna, like, go and investigate this. Whatever. Like, it's
- 36:13very verbose in terms of describing what it's doing. Brock code seems to just,
- 36:18like, do it and then go here's the result at the end, which
- 36:23depending on who you are
- 36:25may or may not be
- 36:26a better option. But I found towards the end of last week that
- 36:31that Groq code was
- 36:34certainly producing results much quicker where Sonnet kept on timing out. But I
- 36:39think Claude had some issues last week, and they made some tweaks to their models
- 36:42or something like that. So maybe that came into play because it seems to be working
- 36:45okay again today.So, anyway, I don't know. I think our code base is, is
- 36:52quite large and some of the stuff that's in there may impair
- 36:57-more than impact what it's doing. -Mm-hmm.
- 37:00And so, yeah. It certainly has gotten through a lot of the boilerplate and a lot
- 37:05of the things that I wouldn't wanna do, like, you know, coming up with mock
- 37:09responses for Salesforce requests. Like, it's figured out what they should look
- 37:13like and
- 37:14the shape of the responses and generating all of the, the bodies. So it's been very
- 37:18good at that. But in terms of tying all the pieces together, I'm not stoked with
- 37:21-it, to be honest. -Yeah.
- 37:23You know, whether, whether or not that's, like, the model is not capable of it or
- 37:26I'm not capable of steering the model at this stage is
- 37:30unclear. But it's just a frustrating thing, and it's, it's turning into a bit
- 37:35of an abusive relationship now because every time I say- ... "Nah, this is crap.
- 37:38I'm not gonna use this anymore. I'm gonna do it myself," I find my way back to it
- 37:41and try again anyway. Maybe this time it'll be different, so.
- 37:45-You get... You're codependent. -It's no, it's no good. But I feel-
- 37:49-There's- -I, I just, I
- 37:51-there's- -There's gonna be a whole industry popping
- 37:52up around, like, AI, like, relationship coaching.
- 37:55Yeah. Yeah. There's, uh, we'll, we'll probably wrap on this, and maybe I'll get
- 38:00your opinion on it and then we can wrap. But
- 38:03I feel like there's a big push
- 38:06as an industry. Like, you see it all the time. Companies are saying, "You've gotta
- 38:09use AI. We're not hiring any more staff unless you can show that you've exhausted
- 38:12all avenues with AI," and, and whatever else. Like, so there's that whole school
- 38:16of thought going on. And, um,
- 38:22I feel like as engineers, as developers that have been in the game for a long
- 38:27period of time, that have, like, done all of the work by hand for a long period of
- 38:30time, sitting there and watching the computer write the code for you, it's
- 38:34like, what am I being paid for now
- 38:37to, like, sit there and just what? Like, I feel very dirty about it. Whereas some
- 38:41people are like, "This is great. I can get more done," I don't feel like it's made
- 38:45me quicker. I feel like it has certainly written more code than I could have over
- 38:49the same period of time. I don't think it's produced the same amount of output
- 38:54and the same amount of value as I could in that same amount of time, if that makes
- 38:57-sense. -Mm. Yeah, so do you-
- 38:59-Um- -You feel like it's actually made, made you
- 39:01less efficient, but it's, it's easier for you?
- 39:04-I don't think it's made me more- -Less produc- not, not less efficient, less
- 39:06-productive? -Yeah.
- 39:07-Do you feel like you're producing less? -Yeah, I feel like... Yeah, 'cause, like,
- 39:11I'm not doing it. I'm watching the computer do it, right?
- 39:14-Sure. -But I feel like what it's producing, I
- 39:16still need to go over, and there's a lot of untangling going on there. So I'm, I'm
- 39:20watching the computer write the code for, you know, hours of a day
- 39:25or across a week, you know, hours of, of, of that week. And it's like, well, what,
- 39:31what am I supposed to be doing while it's
- 39:33churning out code? And then, oh, it's finished. Okay, now I've gotta go and look
- 39:36at it. No, that's no good. Figure out how we're gonna fix it. Okay, then off it
- 39:40goes again. It's like... I don't know. As, as someone who has always written the
- 39:45code, it's like, I understand that I get, you know, you get paid to do the work, but
- 39:50now I'm not doing the work, if that makes sense. So what-
- 39:53-Yeah, yeah -... what, what am I, what am I being paid
- 39:54-for here? -Are you, are you using, are you using it
- 39:56in, like, planning mode first to kinda get it all set up?
- 39:58-Yeah. -And then you... Yeah. Okay.
- 40:00-Yeah. -So you're doing it that way. Okay. Yeah.
- 40:01-Yeah. -I don't know, dude. I, honestly, I wish I
- 40:03could tell you. I feel like tomorrow I actually told Andy Hinkle. I was like,
- 40:07"Dude, you're gonna do a Teaching Tuesday for us tomorrow, and you're gonna show us
- 40:10how you actually go through
- 40:12with Claude and with, uh, Cursor and, and how you actually go through. What's your
- 40:17process, you know? Um, how do you set it up in planning mode? What are the things
- 40:20that you're prompting it with?" And whatever. And there, there are little
- 40:22things. Like, so today he went through and was like, "Here are all the strings that
- 40:28I want to have a passing test for, that it should have this output. And here are all
- 40:33the ones that I have strings that should be ignored, and this is what it should
- 40:37-be," whatever. And then he said- -Mm-hmm
- 40:38... "I need a regex that solves all of these." And it was like, "Okay. Let me
- 40:42wri- let me do this." And he's like, "No, no, no. Start with TDD first. Like, write
- 40:44the test." It was like, "Okay, I'll write the test." Then he's like, "Okay. Now
- 40:47write your regex." And it wrote a single regex that solved all of those, and it
- 40:51-passed- -Mm-hmm
- 40:51-... all the tests. And it's like, okay. -Yeah.
- 40:53Pretty sweet. Like, 'cause Andy's... He's, he's good with... You know, he... I don't
- 40:57think he's ever had to use or, like, had to know exactly what the regex was. Most
- 41:01of the time, you can just kinda, like, Google it, and like, "Okay, I need a regex
- 41:04-for a phone number." -Yeah. Yeah.
- 41:05Great. There we go. You know, I don't know what it means, but whatever.
- 41:07-He's very good at writing regexes. Yeah. -Totally. And, like, I love regex stuff.
- 41:10And so, like, for me, it's very interesting to kinda see him pull it apart
- 41:13and whatever. But it's like, does it really necessary for him to learn all
- 41:17that, or can he just prompt the AI to do that? And so it's like-
- 41:19-Yeah -... there are instances where it's, like,
- 41:20-very useful for that sort of stuff. So- -Mm-hmm.
- 41:22And it was stupid, it would be stupid for him to write that code because s- you
- 41:25-know, it can write it for him. And so- -Yeah.
- 41:27-Um, yeah. I don't know. -For those kinds of things, like, I have
- 41:29definitely found that it's, it's quite good at it. Um, especially, you know, when
- 41:33we've been wanting to figure out... Like, we have
- 41:36in the Salesforce library
- 41:39every- everything that, like, runs a raw query against the Salesforce endpoint, it
- 41:45just sends an execute query request. So it could be a, it could doing a select from
- 41:50contacts or accounts or, you know, whatever else. So the only way to kinda
- 41:54figure out what kind of request is actually being sent in order for us to be
- 41:58able to then fake the response is to inspect the query string. Um, and so,
- 42:04like, it's kinda figured out
- 42:06initially that it, it was writing a regex. I'm like, "I think this is a bit
- 42:09overkill," 'cause I was looking at this regex. I'm like that, that looks very
- 42:13complicated. Uh, let's maybe just use a string contains here and just look for,
- 42:17like, if the query string contains from account, it means that we're doing an
- 42:21account lookup so we can return the account if it... You know, all of that
- 42:24kinda stuff. But
- 42:26it's... Yeah. There, there are things... I haven't formulated a concrete opinion on
- 42:30it yet. There are certainly things that it can do and does well. Like, I love using
- 42:33-it to go and fix PHP stand violations. -Mm.
- 42:37'Cause it's like, ah, I don't wanna go through that. Um-
- 42:39-Yeah -... especially when you update a, a patch
- 42:41release and end up with 90 or whatever
- 42:45stand violations that weren't there before the update, like I did yesterday.
- 42:50Um...... but, uh, yeah. There are also things that, even guided, like, "Okay. I
- 42:56want a- I want you to create a- a registry of these things." Or "I want it..." You
- 43:01know, if you- if you're very specific and very guided, um, it can go and generate a
- 43:05lot of code. But then you've gotta go and look at it, because, um, it doesn't do
- 43:10things quite as well as I would hope for code that I want to ship into production.
- 43:14Because, yeah, the AI may have written it, but then I have to support it. So...
- 43:20That's the main thing. Like, you do still need to understand it in, you know, in a
- 43:24-professional capacity. -Yeah.
- 43:25Like, if you're- if you're a non-programmer and you're just trying to
- 43:29bring your ideas to life... I spoke to a friend the other day who's a- a UX
- 43:33researcher, and he built this thing, um,
- 43:37that does
- 43:39some analysis. I don't wanna go too much into it, 'cause he's still building it
- 43:41out. But he built this as, like, a- a next app, um, and, like, all of his stuff, it-
- 43:47it does all the analysis, it provides reports, it shows you all these different
- 43:51things, that over the last month and a half, two months, he's built himself. Um,
- 43:57because he knows, like, what comes out the other side of it, he knows what he's
- 44:01expecting there. But if you looked under the- under the hood of all of that code,
- 44:06it's not gonna be something that you'd wanna maintain. For that use case-
- 44:10-Yeah -... where you're building something that
- 44:12-you would not have otherwise had- -It's... Yeah. You could toss-
- 44:14-... the time, the capability- -Yeah
- 44:15... the money to- to do, you know, it doesn't matter. But he's pro- providing
- 44:19-value in the outcomes. So... -Yeah.
- 44:22But as a software engi- uh, I keep saying engineer. As a software developer, I find
- 44:26myself endlessly frustrated by what it puts out, um,
- 44:31-and I'm- I'm not- not convinced by it. -Yeah.
- 44:36Yep. Like I said, it's just... It always... The answer is it depends, right?
- 44:40Yeah.
- 44:40-As with anything. -Yeah.
- 44:41As with anything. All right, my friends. Why don't we wrap it there? Uh, this is
- 44:47-gonna be Episode 183? -183.
- 44:51-183? -Mm-hmm.
- 44:51Thanks for hang- thanks for hanging out with us, folks. Find those show notes for
- 44:54this episode at northmeetsouth.audio/183. Hit us up on Twitter, on X, on Bluesky,
- 44:59@MichaelDurant, @JacobBennett, or at North South Audio. And if you liked the show,
- 45:04rate it up in your podcatcher of choice. Five stars would be incredible. Thanks,
- 45:07-folks. Until next time. We'll see ya. -Bye.