
Laravel News Podcast
·E244
New Pest, speaker bingo, and Laravel in Practice
Episode Transcript
1
00:00:03,920 --> 00:00:08,780
This is the Laravel News Podcast, your
one-stop podcast to find out about
2
00:00:08,780 --> 00:00:14,180
Laravel-related news, tutorials, packages,
and more. Here are your hosts, Jake
3
00:00:14,180 --> 00:00:15,280
Bennett and Michael
4
00:00:15,280 --> 00:00:22,600
Dyrynda.
5
00:00:31,380 --> 00:00:38,040
Hello, friends and neighbors and loved
ones. Welcome to Laravel News. This is
6
00:00:38,040 --> 00:00:42,540
-episode...
-244.
7
00:00:43,500 --> 00:00:48,420
244, folks. It has been, uh, a bit of a
rough start for us. Let's... I- I'm not
8
00:00:48,420 --> 00:00:53,060
gonna beat around the bush here. Okay? I
was supposed to be on this call 26 minutes
9
00:00:53,060 --> 00:00:56,300
ago, and I woke up 12 minutes ago
10
00:00:57,120 --> 00:01:00,960
because... You know, I- I don't know,
dude. I'm not sure if it's that time of
11
00:01:00,960 --> 00:01:03,470
year. I honestly do not know. It has been-
12
00:01:03,470 --> 00:01:04,1000
-No idea
-... this week, I have been so
13
00:01:06,100 --> 00:01:10,730
tired. Yesterday, I was, like, I was in
bed early
14
00:01:11,520 --> 00:01:16,860
and, like, woke up late this morning and
then another... Like, just exhausted. I'm
15
00:01:16,860 --> 00:01:20,200
not sure if it's, like, the time, like,
you know, changing of the seasons. I have
16
00:01:20,200 --> 00:01:24,080
no idea. My kids are feeling it too,
though. Dude, I don't know. So-
17
00:01:24,080 --> 00:01:25,060
-Possibly.
-Thank you.
18
00:01:25,060 --> 00:01:26,500
-I am.
-Yeah.
19
00:01:26,500 --> 00:01:28,460
It was interesting listening to
20
00:01:30,000 --> 00:01:33,240
Ian Landsman on The Mostly Technical Podcast
talking about, you know,
21
00:01:34,100 --> 00:01:38,940
having showers at night versus in the
morning and how, because he has hay fever,
22
00:01:38,940 --> 00:01:40,760
-he showers before night to, like-
-Oh
23
00:01:40,760 --> 00:01:44,060
... make sure all of the pollen is out of
the hair, so then you're not sleeping and
24
00:01:44,060 --> 00:01:47,1000
rolling around in the pollen. And it's,
it's definitely getting to that time of
25
00:01:48,000 --> 00:01:52,600
year where we're, we are definitely
getting the fits and starts of spring. So
26
00:01:52,600 --> 00:01:57,020
it was sunny yesterday, it rained this
morning, but the sun's out today. Um, you
27
00:01:57,020 --> 00:02:00,720
know, we're losing the, the undergarments
now. We're, you know, no more singlets,
28
00:02:00,720 --> 00:02:06,060
just long sleeves. It's supposed to be
warm on, on the weekend. So, uh, all of
29
00:02:06,060 --> 00:02:09,880
this is fantastic, but it also means that
the pollen is coming. And this-
30
00:02:09,880 --> 00:02:12,1000
-Mm-hmm, mm-hmm
-... I cannot abide because- ... I'm, I, I
31
00:02:13,000 --> 00:02:18,1000
long for the days when I didn't have hay
fever, and now it's quite severe. So time
32
00:02:19,000 --> 00:02:24,019
-to start loading up on antihistamines.
-That's right. That's right. It is coming
33
00:02:24,020 --> 00:02:26,100
whether you want it to or not. So folks,
34
00:02:27,440 --> 00:02:32,480
welcome to the show. And, uh, I'm glad
you're here. I'm glad to be here. Today is
35
00:02:32,480 --> 00:02:36,760
September 3rd, 2025. We are gonna get
into it with releases, with news, with
36
00:02:36,760 --> 00:02:38,520
packages, with tutorials,
37
00:02:39,300 --> 00:02:40,160
as always. So
38
00:02:40,980 --> 00:02:46,280
let us start at the very top with
releases. I'm gonna be talking about
39
00:02:46,280 --> 00:02:46,920
Laravel
40
00:02:47,680 --> 00:02:50,980
12.26.
41
00:02:51,880 --> 00:02:56,860
Soon as I get my- ... video in the right
place. There it is. Okay. Here we are,
42
00:02:56,860 --> 00:03:03,460
folks. Laravel 12.26 released the week of
August 26th, which has a withHeartbeat
43
00:03:03,460 --> 00:03:08,900
method to LazyCollections, a toPrettyJSON
method to Collections, Models, and more,
44
00:03:08,900 --> 00:03:14,620
et cetera. Let's start with React and Vue
Starter Kits, which now include Wayfinder.
45
00:03:14,620 --> 00:03:18,720
So Joe Tenenbaum updated the Laravel
React and Vue Starter Kits to include a
46
00:03:18,720 --> 00:03:24,459
Laravel Wayfinder. What is Wayfinder, you
might ask? Wayfinder provides a type-safe
47
00:03:24,460 --> 00:03:29,300
bridge between Laravel Routes and your
front end. If you've ever used Ziggy
48
00:03:29,300 --> 00:03:36,220
before, uh, Wayfinder is Ziggy improved.
It is Ziggy plus. Uh, it does a
49
00:03:36,220 --> 00:03:42,820
lot of amazing things. It makes the pieces
of your back-end application available to
50
00:03:42,820 --> 00:03:47,310
your front end in a type-safe way. Not
only Routes, but lots more. So you should
51
00:03:47,310 --> 00:03:50,440
definitely check that out. And it totally
makes sense that it would now be included
52
00:03:50,440 --> 00:03:54,1000
in the Vue Starter Kits and React Starter
Kits because that's where it's going to be
53
00:03:55,000 --> 00:03:59,220
most powerfully used. Right? So there you
have it added to the Starter Kits.
54
00:03:59,220 --> 00:04:04,160
withHeartbeat method has been added to
LazyCollections. Joseph Silver contributed
55
00:04:04,160 --> 00:04:07,480
the new withHeartBeat method to
LazyCollections, which allows you to run a
56
00:04:07,480 --> 00:04:13,160
callback at regular intervals while the
collection is being lazily enumerated. So
57
00:04:13,160 --> 00:04:18,120
his primary use case that he shared in the
pull request is stated as such. In
58
00:04:18,120 --> 00:04:22,740
long-running tasks, such as bass- batch
processing por- reports, you may need to
59
00:04:22,740 --> 00:04:26,200
hold a lock to prevent concurrent
execution. However, if the code
60
00:04:26,200 --> 00:04:30,1000
unexpectedly fails to release the lock if
you don't want it to persist indefinitely.
61
00:04:31,000 --> 00:04:33,880
So a common strategy is to acquire a
short-lived lock, and then you
62
00:04:33,880 --> 00:04:38,380
periodically extend it while the task is
still running. So an example is ac-
63
00:04:38,380 --> 00:04:42,120
requiring the lock for five minutes, then
re-acquiring it every four minutes,
64
00:04:42,120 --> 00:04:46,170
assuming that a report never takes a full
minute to generate. So instead of saying,
65
00:04:46,170 --> 00:04:48,520
"I'm going to lock that program
indefinitely
66
00:04:49,140 --> 00:04:55,560
and then my, uh, I will unlock it once my
task is done running." Like, you can think
67
00:04:55,560 --> 00:04:59,599
that, uh, when you do commands that are
in the background, Laravel will do this
68
00:04:59,600 --> 00:05:03,360
actually. It will take a mutex, and it
will store that mutex in the cache, and it
69
00:05:03,360 --> 00:05:05,120
will check itself to see
70
00:05:05,720 --> 00:05:09,160
if that command has finished yet. And if
it hasn't, it won't allow it to overlap.
71
00:05:09,160 --> 00:05:12,620
Right? There might be some reason why
you'd wanna do a lock like that. Well, in
72
00:05:12,620 --> 00:05:15,920
this case, instead of setting it for
forever, just say, "Nope. We're just gonna
73
00:05:15,920 --> 00:05:18,700
leave... Have it for five minutes. We'll
release it after that. And then every four
74
00:05:18,700 --> 00:05:21,620
minutes, we'll make sure that we
reacquire that lock." So yeah, really
75
00:05:21,620 --> 00:05:25,060
interesting. The documentation's been
updating to include this, uh, in dup-
76
00:05:25,060 --> 00:05:28,700
sorry. Has been updated to include this
section about that new withHeartBeat
77
00:05:28,700 --> 00:05:32,240
method, but that's an interesting one
there. Thank you, Joseph Silver.
78
00:05:32,240 --> 00:05:36,860
PrettyJSON method. Wendell Adriel
contributed a toPrettyJSON method. What
79
00:05:36,860 --> 00:05:42,600
this does is it will, um, it will be
implemented in all the places where the
80
00:05:42,600 --> 00:05:47,940
toJSON method exists. So for example,
collections, models, JSON resources,
81
00:05:47,940 --> 00:05:53,332
paginators, et cetera. Uh, an
example...From full request 56697 using
82
00:05:53,332 --> 00:05:57,072
collections where it previously would've
had collection error to JSON, you can now
83
00:05:57,072 --> 00:06:02,592
say to pretty JSON. So, um, you know,
we're all used to seeing the, the nasty
84
00:06:02,592 --> 00:06:06,272
output and then you copy and paste it over
into Sublime and you say, "Set the syntax
85
00:06:06,272 --> 00:06:07,482
-to JSON," and pretty-
-Full map
86
00:06:07,482 --> 00:06:08,732
-... you know, print sort of deal.
-Mm-hmm.
87
00:06:08,732 --> 00:06:12,412
You don't have to do that anymore. It will
just do it. You can do to pretty JSON.
88
00:06:12,412 --> 00:06:16,732
It'll give you a nicely formatted output
there, uh, that is now available. Folks,
89
00:06:16,732 --> 00:06:21,932
that is the diff there for f- uh, version
12.26. Of course, you can see the full set
90
00:06:21,932 --> 00:06:27,072
of release notes on GitHub, if you care
to. That's a good one. All right, dude.
91
00:06:27,072 --> 00:06:33,232
-Over to you.
-Laravel 12.27 introduced things such as
92
00:06:33,232 --> 00:06:38,092
support for the SQS FIFO queue message
group IDs, uh, which unlocked the ability
93
00:06:38,092 --> 00:06:43,912
to utilize Amazon's Fair Queue feature in
SQS. Uh, we'll talk about that and more
94
00:06:43,912 --> 00:06:49,272
now. Nior Mohammed Zaki, one of the
Laravel core team, contributed support for
95
00:06:49,272 --> 00:06:54,572
FIFO queue message group IDs. As
mentioned, this enables Laravel SQS queue
96
00:06:54,572 --> 00:06:59,512
driver to utilize Amazon's Fair Queue
feature. The Laravel documentation has
97
00:06:59,512 --> 00:07:04,012
been updated in kind with details on this
and fair queues, and you can see the
98
00:07:04,012 --> 00:07:10,552
Amazon SQS documentation for more about
them as well. Casey Dwyer contributed the
99
00:07:10,552 --> 00:07:15,012
ability to prepend the count when using
the string plural method. So, often we've
100
00:07:15,012 --> 00:07:18,871
done this thing where we wanted to say,
like, number and then the string plural
101
00:07:18,871 --> 00:07:22,532
and then, you know, then we pass the count
again and we do the thing. Now you can
102
00:07:22,532 --> 00:07:27,512
pass a third argument to the string plural
method, which is a Boolean flag
103
00:07:27,512 --> 00:07:31,671
defaulting to false to preserve backwards
compatibility, which will automatically do
104
00:07:31,671 --> 00:07:36,972
this for you so you don't need to do the
concatenation dance there. So thank you,
105
00:07:36,972 --> 00:07:43,171
Casey Dwyer, for that one. Uh, Jake just
spoke about the pretty JSON functionality
106
00:07:43,171 --> 00:07:49,332
that was added in Laravel 12.26. Lucas
Michaud contributed the ability to pass
107
00:07:49,332 --> 00:07:53,652
additional parameters to the pretty JSON
method, giving developers more control
108
00:07:53,652 --> 00:07:58,192
over encoding when using this method. Uh,
so this is a unary
109
00:07:59,092 --> 00:08:03,712
type that you can pass through with a
bunch of PHP-defined options that allow
110
00:08:03,712 --> 00:08:07,912
you to manipulate what that pretty JSON
looks like. Obviously by default it is to
111
00:08:07,912 --> 00:08:11,912
format it, but you can also pass, uh,
parameters to do things like, uh,
112
00:08:11,912 --> 00:08:17,392
unescaped Unicode characters and so on. So
thank you to Lucas for that. And last up
113
00:08:17,392 --> 00:08:21,611
in our notes here, Jesper Nordset
contributed support for enum values in
114
00:08:21,611 --> 00:08:26,552
collection countBy and groupBy methods by
converting them to strings or ints as
115
00:08:26,552 --> 00:08:31,272
array keys. So we've seen backed enums
throughout the framework, uh, everywhere,
116
00:08:31,272 --> 00:08:34,152
so this allows you to do countBy key and
then pass
117
00:08:35,092 --> 00:08:41,052
enums directly into those, um, arrays as
values and it will handle the casting to
118
00:08:41,052 --> 00:08:46,291
n- numeric values for you when you call
something like all, for example. But also
119
00:08:46,291 --> 00:08:50,352
giving the ability to implicitly count
without having to pass a, a closure and,
120
00:08:50,352 --> 00:08:52,232
and handling that for yourself manually.
121
00:08:52,912 --> 00:08:55,622
That's all we have for releases this week.
122
00:08:57,172 --> 00:09:03,052
All right, folks. Um, this is not a
Laravel release, but it is a release
123
00:09:03,052 --> 00:09:06,531
nonetheless. And we are so excited about
it, we actually have it listed twice in
124
00:09:06,531 --> 00:09:12,932
our show notes, which is that Pest 4 has
now been officially released. So this is
125
00:09:12,932 --> 00:09:16,312
going to allow you to get started if
you... Let's, let's back up. In case
126
00:09:16,312 --> 00:09:22,412
you've been living under a rock for the
last couple years, Pest is a
127
00:09:22,892 --> 00:09:24,122
new and improved
128
00:09:24,812 --> 00:09:30,712
version of PHPUnit. Can I say that? I
think so. It's built on top of PHPUnit.
129
00:09:30,712 --> 00:09:35,992
Pest 4 is in fact built on top of PHPUnit
12. Um, it's a superset of that, right? So
130
00:09:35,992 --> 00:09:41,992
it runs on PHPUnit but it allows for this
beautiful syntax. Um, it takes care of a
131
00:09:41,992 --> 00:09:46,712
lot of the things. It's, it's actually
not, um, Laravel specific, right? It's not
132
00:09:46,712 --> 00:09:51,252
locked to Laravel, it's, it's available
for use in, uh, other testing
133
00:09:51,252 --> 00:09:54,212
environments. Anything where you would use
PHPUnit you could use Pest. Really,
134
00:09:54,212 --> 00:09:57,732
really good stuff. Was, what, what's
different about Pest 4 that we care about?
135
00:09:57,732 --> 00:10:03,291
Let's talk about that. So, the big thing
about Pest 4 is browser testing. So this
136
00:10:03,291 --> 00:10:07,310
is, um, the brand new feature that's
unlocked allowing you to run tests in your
137
00:10:07,312 --> 00:10:08,812
browser using
138
00:10:09,731 --> 00:10:14,612
not the old one. Uh, what was the old one?
I'm trying to remember. It's like, you
139
00:10:14,612 --> 00:10:18,572
know, we use Chromeless, uh, browser. What
was it?
140
00:10:18,572 --> 00:10:20,791
Yeah, it was browser... Eh, not browser.
Dusk.
141
00:10:20,791 --> 00:10:22,791
-Headless, headless Chrome browser.
-The headless... Yeah, it was-
142
00:10:22,791 --> 00:10:23,402
-Yeah, it was Dusk-
-It was-
143
00:10:23,402 --> 00:10:26,152
... but I'm trying to remember what the,
uh... There was, like, Selenium, which was
144
00:10:26,152 --> 00:10:27,472
-the old school one.
-Chromium, wasn't it?
145
00:10:27,472 --> 00:10:28,932
-Right? Yep. Yeah.
-Is this what you're looking for?
146
00:10:28,932 --> 00:10:32,291
So there was like Selenium, which was old,
old. And then you would use, like,
147
00:10:32,291 --> 00:10:35,852
Chromium, right, version. Like this
headless browser Chromium sort of deal.
148
00:10:35,852 --> 00:10:40,592
-Mm-hmm.
-This uses Playwright. So Playwright is a
149
00:10:40,592 --> 00:10:45,291
new version of, uh... We- we've talked
about it on the show before, right? But it
150
00:10:45,291 --> 00:10:47,791
basically is a new and improved version
of
151
00:10:48,752 --> 00:10:49,051
the old
152
00:10:49,752 --> 00:10:53,531
headless Chrome browser. I, again, I'm,
I'm oversimplifying here, right? There's a
153
00:10:53,531 --> 00:10:57,652
lot of amazing benefits that we've talked
about for why Playwright is, uh, a great
154
00:10:57,652 --> 00:11:03,031
choice moving forward. Um, but Nuno has
done the hard work of wrapping up all
155
00:11:03,031 --> 00:11:08,702
those APIs and building them into Pest so
that you can continue to use your new PHP,
156
00:11:08,702 --> 00:11:13,372
uh, your new favorite PHP testing
framework, Pest, um, with Playwright. So
157
00:11:13,372 --> 00:11:16,912
really, really cool stuff here. So let's
talk about what that is. End-to-end
158
00:11:16,912 --> 00:11:21,771
browser testing. You also have visual
testing, so you can get visual diffs.
159
00:11:21,771 --> 00:11:26,192
Device testing, so you can say on iPhone
it should look like this, on desktop it
160
00:11:26,192 --> 00:11:31,531
should look like this. Uh, code coverage
with browser and unit tests. You can also
161
00:11:31,531 --> 00:11:36,972
launch a tinker session mid-test, which is
really, really cool. Um, you can have
162
00:11:36,972 --> 00:11:43,932
test sharding, so, like, across your, um,
CI actions. So you
163
00:11:43,932 --> 00:11:46,072
have this idea that you can run
164
00:11:46,872 --> 00:11:51,051
things in parallel, right? Um, you could
always do that with PHPUnit or with
165
00:11:51,051 --> 00:11:58,040
Pest.... really difficult to accomplish
browser tests. Um, but Pest will help with
166
00:11:58,040 --> 00:12:03,160
that and will allow you to run more than
two instances in parallel by doing
167
00:12:03,160 --> 00:12:07,400
sharding, which basically means it will
take your test suite, it will break it up
168
00:12:07,400 --> 00:12:11,600
into however many groups of things you
want to run, and then you can run those
169
00:12:11,600 --> 00:12:15,659
all at the same time across different
actions. So previously, because with
170
00:12:15,660 --> 00:12:18,720
GitHub Actions, you only have two
processors at max that you could use for
171
00:12:18,720 --> 00:12:22,500
their test runners, you could only run two
instances of parallel at a time, right?
172
00:12:22,700 --> 00:12:25,1000
With sharding, you can say, "I wanna run
eight," and it'll spin up four different
173
00:12:26,000 --> 00:12:30,220
GitHub Action runners, and will allow you
to run all of those at the same time.
174
00:12:30,220 --> 00:12:33,380
Really, really cool stuff, uh, and allows
your test suites that used to take 30
175
00:12:33,380 --> 00:12:36,860
minutes down to, like, five minutes.
Right? Uh, so there's a whole official
176
00:12:36,860 --> 00:12:42,540
announcement post if you were not able to
catch, um, Nuno's release of Pest 4 live
177
00:12:42,540 --> 00:12:46,800
on stage at Laracon this year. We also
have a link to that, so you can watch that
178
00:12:46,800 --> 00:12:51,300
on YouTube. So lots of really, really
cool stuff. There is an announcement post
179
00:12:51,300 --> 00:12:54,500
that kind of goes over all the different
things that I just talked about with far
180
00:12:54,500 --> 00:12:58,400
more detail. And then there's also an
upgrade guide that was gonna allow you to,
181
00:12:58,400 --> 00:13:03,640
uh, go from Pest 3 applications to Pest 4
applications. And then lastly, I wanted
182
00:13:03,640 --> 00:13:10,340
to mention that Jason Mercuri, uh, Laravel
Shift, has created a, a Dusk to
183
00:13:10,340 --> 00:13:15,420
Pest ta- uh, conversion, and so you can
run that as well. That will attempt to
184
00:13:15,420 --> 00:13:20,600
take your Dusk tests and convert them over
to your Pest v4 browser testing, uh,
185
00:13:20,600 --> 00:13:24,440
paral- uh, you know, browser testing
equivalents. So good stuff on that. Lots
186
00:13:24,440 --> 00:13:28,900
of options there, lots of ways to get
started, and really, really exciting, uh,
187
00:13:28,900 --> 00:13:32,680
-exciting stuff there.
-Well, sure. Uh, I wanna say two things
188
00:13:32,680 --> 00:13:37,660
about sharding. Number one, the way you
say it, uh, is very close to dangerous. So
189
00:13:37,660 --> 00:13:38,720
-just, uh-
-Sharding
190
00:13:38,720 --> 00:13:41,330
-... just be careful there. Sharding.
-How- I, I know.
191
00:13:41,330 --> 00:13:43,040
-Uh-
-Like, it is a weird, it is a weird word. I
192
00:13:43,040 --> 00:13:46,460
don't know how else you would sa- shard?
Is it sharding? How would you say it?
193
00:13:46,460 --> 00:13:51,140
You say shard. But, see, well, it... The D
very-
194
00:13:51,140 --> 00:13:52,490
-I want, I want you to give me-
-Comes close to a T
195
00:13:52,490 --> 00:13:53,540
-... the good version of it-
-Sharding.
196
00:13:53,540 --> 00:13:54,410
-... and I want you to give me the bad-
-Sharding
197
00:13:54,410 --> 00:13:57,620
-... version of it.
-See, we, we, we... So there's, there's
198
00:13:57,620 --> 00:13:59,660
-sharding, right? But if-
-Sharding.
199
00:13:59,660 --> 00:14:00,260
-The way-
-Sharding.
200
00:14:00,260 --> 00:14:03,960
The way, the way you sha- sharding, the
way you say sharding, it, it, it, it
201
00:14:03,960 --> 00:14:07,980
crosses into dangerous- ... inappropriate
territory. So I just wanted to say that,
202
00:14:07,980 --> 00:14:10,129
-number one.
-We need to have, like... We need to have,
203
00:14:10,129 --> 00:14:12,390
like... You know how, like, I say beta and
you say beta?
204
00:14:12,390 --> 00:14:14,080
-Yeah.
-Like, beta testers or whatever.
205
00:14:14,080 --> 00:14:15,420
-Uh-huh.
-Like, we need to have an equivalent for
206
00:14:15,420 --> 00:14:20,900
this word. Is it, like, uh, I don't know.
Like, how do you say it differently? I
207
00:14:20,900 --> 00:14:22,260
-don't know.
-I, I don't think there's, there's an
208
00:14:22,260 --> 00:14:24,560
-answer. I just think it's, uh... Anyway.
-Sharding.
209
00:14:24,560 --> 00:14:25,780
-But-
-Maybe sharding.
210
00:14:25,780 --> 00:14:29,300
Sharding. So as part of, uh, some work
that I'm doing at the moment, I did
211
00:14:29,300 --> 00:14:34,620
upgrade our code base from Pest3 to Pes-
Pest4, which was mostly a straightforward
212
00:14:34,620 --> 00:14:39,570
transition. Obviously, Pest4 requires PHP
unit version 12, which we had some-
213
00:14:39,570 --> 00:14:39,720
Okay, yep
214
00:14:40,400 --> 00:14:43,939
... you know, interdependent issues, you
know, dependency of a dependency of a
215
00:14:43,940 --> 00:14:48,159
dependency that we have forks of to, to
keep alive because they technically only
216
00:14:48,160 --> 00:14:50,320
work for Laravel 6, and we're on Laravel
11.
217
00:14:51,000 --> 00:14:57,840
Um, but using the shard functionality
inside of GitHub Actions took our test
218
00:14:57,840 --> 00:14:59,879
run... Like, it halved our test runtime.
So it's-
219
00:14:59,880 --> 00:15:02,969
-Wow. That's incredible, yeah
-... we've split our suite up into five.
220
00:15:02,969 --> 00:15:07,480
And so each shard runs for about two
minutes. So our-
221
00:15:07,480 --> 00:15:10,960
-Okay
-... total cumulative runtime for our test
222
00:15:10,960 --> 00:15:15,300
is about seven and a half minutes now,
where it was 16 before. So it's a-
223
00:15:15,300 --> 00:15:17,020
-Wow. That's amazing
-... it's a huge improvement, um-
224
00:15:17,020 --> 00:15:19,480
-Yeah
-... just, just by turning that on. And
225
00:15:19,480 --> 00:15:22,660
then, obviously, we've got, you know,
caching between, um, different test
226
00:15:22,660 --> 00:15:26,140
executions and things like that. But it's,
uh... I, I haven't even looked-
227
00:15:26,140 --> 00:15:28,180
-That's amazing
-... at the Playwright stuff yet. Uh, I
228
00:15:28,180 --> 00:15:32,700
know that our front end guys did a bit of
work to convert all of the Cypress tests.
229
00:15:32,700 --> 00:15:37,900
Like, this was already underway before
Pest4 was announced, so rewriting our
230
00:15:39,040 --> 00:15:43,360
Cypress test into Playwright. But now that
Pest supports Playwright-
231
00:15:43,360 --> 00:15:45,820
-Yeah
-... uh, on the back end, we can, we can
232
00:15:45,820 --> 00:15:49,420
now do more comprehensive end-to-end tests
as well, which, which I'm really looking
233
00:15:49,420 --> 00:15:53,720
forward to. I think that will really, um,
you know, for us specifically, but for the
234
00:15:53,720 --> 00:15:58,060
community at large, it's gonna make
testing those things, making them robust,
235
00:15:58,060 --> 00:16:02,020
much, much more powerful across the board.
236
00:16:02,020 --> 00:16:06,520
Absolutely. Yep. Super excited. I, I can't
wait to, to get in there and try it. Uh,
237
00:16:06,520 --> 00:16:10,379
we've got a couple things that we're
prioritizing before we head to that, uh,
238
00:16:10,379 --> 00:16:14,100
as the next list on... or next item on the
list. But we will get there. We have no
239
00:16:14,100 --> 00:16:17,080
doubt we will get there and, uh, take
advantage of that. Super excited. I'll
240
00:16:17,080 --> 00:16:21,610
-keep you updated.
-Mm-hmm. Yeah. Uh, the Laracon Australia
241
00:16:21,610 --> 00:16:26,220
2025 talk titles have been revealed.
They're up on the website at
242
00:16:26,220 --> 00:16:31,260
laracon.au/schedule, and we have placed
all of the titles up there. And so whilst
243
00:16:31,260 --> 00:16:34,1000
the speaker lineup has been announced, uh,
already earlier this year, the talks
244
00:16:35,000 --> 00:16:39,080
themselves have until now been a mystery.
And for an extra twist, we're not going to
245
00:16:39,080 --> 00:16:40,260
link the speakers
246
00:16:40,920 --> 00:16:44,640
with their talk titles until next month,
which gives the opportunity, a chance to
247
00:16:44,640 --> 00:16:49,800
guess who's presenting what topic. And to
make it fun for attendees, we're running a
248
00:16:49,800 --> 00:16:54,579
giveaway. If you can guess the correct
pairings for each of the talks, you could
249
00:16:54,580 --> 00:16:59,240
win one of our very special limited
edition hoodies to collect if you are
250
00:16:59,240 --> 00:17:05,540
attending in Brisbane this November.
Entries close Sunday the 14th of November
251
00:17:05,540 --> 00:17:12,530
at 11:59 PM Eastern Standard Time. Uh,
anyone can play this, of course, but only
252
00:17:12,530 --> 00:17:17,819
a, uh, attendee will be able to collect
the prize. This year's theme is Level Up,
253
00:17:17,819 --> 00:17:21,019
and the program reflects a wide range of
topics for developers looking to push
254
00:17:21,020 --> 00:17:25,319
their skills further. Tickets are still
available, including a limited allocation
255
00:17:25,319 --> 00:17:29,560
of early bird tickets, which are now open
to both individuals and small teams of up
256
00:17:29,560 --> 00:17:34,100
to four per, per transaction. And premium,
bundle, and community sponsor tickets are
257
00:17:34,100 --> 00:17:37,880
still availble- available, along with
group discounts for larger teams, which
258
00:17:37,880 --> 00:17:41,280
you can grab at laracon.au/tickets.
259
00:17:42,760 --> 00:17:48,120
Very good. Okay. So I'm gonna... Uh, I...
That one, is that under news? Because I
260
00:17:48,120 --> 00:17:51,420
think it must have replaced one of the
other links or something. I wanna make
261
00:17:51,420 --> 00:17:51,570
-sure-
-Okay
262
00:17:51,570 --> 00:17:52,940
... I'm in the right spot and not
skipping.
263
00:17:52,940 --> 00:17:55,300
-Oh, yes. It is under news. I, uh-
-Okay
264
00:17:55,300 --> 00:17:55,750
-... must have put the-
-Okay. Gotta fix it
265
00:17:55,750 --> 00:17:58,080
... wrong thing into the Notion document.
I will fix now.
266
00:17:58,080 --> 00:18:02,360
Not a problem. Not a problem at all. Okay,
folks. We are gonna move on to packages,
267
00:18:02,360 --> 00:18:06,952
shall we? So-Let's talk about ownership
relationships between eloquent models with
268
00:18:06,952 --> 00:18:11,071
Laravel ownable. Michael, I feel like you
might have had something like this back
269
00:18:11,072 --> 00:18:14,932
in the day. Did you have your own package
that sort of did something like this?
270
00:18:14,932 --> 00:18:20,912
Yes, I had something similar. It was- it
was much less comprehensive. Like, it was
271
00:18:20,912 --> 00:18:21,302
just
272
00:18:21,912 --> 00:18:27,012
an owned by thing, which, you know, you
can realistically do using
273
00:18:27,012 --> 00:18:30,492
-Eloquence's method now.
-Sure.
274
00:18:31,132 --> 00:18:31,312
Yeah.
275
00:18:32,292 --> 00:18:38,012
Sure. So, let's talk about this package.
Um, Michael used to be a prolific package
276
00:18:38,012 --> 00:18:42,242
author back in the day. In fact, that is
the story of how we met. Uh-
277
00:18:42,242 --> 00:18:44,772
-Mm-hmm.
-Michael had an amazing nullable fields
278
00:18:44,772 --> 00:18:48,192
package, which just fit the bill for
something I needed, and I was using it all
279
00:18:48,192 --> 00:18:52,412
the time. And every time I used it, I was
like, "Michael, dude! This is so awesome.
280
00:18:52,412 --> 00:18:55,972
Thanks for making this." And I was like,
"Hey, should we start a podcast? We should
281
00:18:55,972 --> 00:18:58,432
definitely start a podcast." "Are you
going to Laracon?" I'm definitely going to
282
00:18:58,432 --> 00:19:02,022
Laracon, yeah. It's the start of a
beautiful relationship, and it's been-
283
00:19:02,022 --> 00:19:02,972
-Long-
-What? Like, eight years now?
284
00:19:02,972 --> 00:19:07,292
-It's 10 years. Be 10 years next year.
-10 years? Dang. 10 years. Crazy, crazy.
285
00:19:07,292 --> 00:19:11,852
So, anyway, let's talk about ownership
relationship packages. All right, Laravel
286
00:19:11,852 --> 00:19:16,591
Ownable package created by Abdulla
Sawaliam, provides a flexible and
287
00:19:16,592 --> 00:19:20,352
straightforward way to manage ownership of
any model by another model in your
288
00:19:20,352 --> 00:19:26,192
Laravel application. So, uh, a user might
own, uh, another user in a
289
00:19:26,192 --> 00:19:31,212
manager-employee or manager-team member
sort of relationship. Uh, you might have a
290
00:19:31,212 --> 00:19:37,792
user that owns a blog post, or a blog
post that belongs to a user. Uh, key
291
00:19:37,792 --> 00:19:42,272
features of this package would be flexible
ownership, meaning any model can own any
292
00:19:42,272 --> 00:19:47,412
other model. You can transfer ownership
between different owners. You can also
293
00:19:47,412 --> 00:19:52,612
keep track of those ownership changes over
time. Think like a ownership history log.
294
00:19:52,612 --> 00:19:57,012
You can easily retrieve the current owner
of any ownable item. You can check the
295
00:19:57,012 --> 00:20:01,552
ownership status and manage multiple
ownables in bulk operations. It will
296
00:20:01,552 --> 00:20:05,372
automatically clean up ownership records
when models are deleted, so it'll take
297
00:20:05,372 --> 00:20:08,692
care of, like, that cascading problem
there. And then it also has facade
298
00:20:08,692 --> 00:20:13,212
support, you can use the convenient owner
facade for ownership operations. So,
299
00:20:13,212 --> 00:20:18,112
there's some example usages in here. Uh,
it's- it's quite simple, where you are
300
00:20:18,112 --> 00:20:23,012
going to implement an owner contract. You
use a trait of 'has ownables' and then you
301
00:20:23,012 --> 00:20:27,732
have a 'is ownable', uh, trait that you
can use in an ownable contract for the
302
00:20:27,732 --> 00:20:31,792
other side of that relationship. So we
have a user, which has a owner contract,
303
00:20:31,792 --> 00:20:35,792
and then you have a task, which is a
ownable contract. So with those two things
304
00:20:35,792 --> 00:20:39,912
in place, then you can say, "User, give
ownership to task." So you could say, you
305
00:20:39,912 --> 00:20:43,372
know, in very plain English, "Giving a
user ownership of a task," or you can
306
00:20:43,372 --> 00:20:46,752
transfer that to another user. You can get
the current user. You can remove
307
00:20:46,752 --> 00:20:50,752
ownership, just as you would assume. Uh,
but it's very, very simple. The API looks
308
00:20:50,752 --> 00:20:54,632
really nice there, and you get all those
things we talked about along with that,
309
00:20:54,632 --> 00:20:58,972
right? The ownership history, transfer
operations, bulk operations, et cetera. So
310
00:20:58,972 --> 00:21:03,052
this is something you find yourself
needing to do, uh, that would be really
311
00:21:03,052 --> 00:21:06,732
helpful for you to take a look at this
package. Uh, you should definitely check
312
00:21:06,732 --> 00:21:08,832
that one out. Thanks, Yannick, for writing
that up.
313
00:21:08,832 --> 00:21:09,152
Yeah.
314
00:21:10,372 --> 00:21:16,172
Larapath is a secure, fluent path builder
for PHP, featuring senet- sanitization
315
00:21:16,172 --> 00:21:20,972
strategies and Laravel integrations for
version 11 and above. The package's use
316
00:21:20,972 --> 00:21:25,372
case range from multi-tenant storage
organization with privacy protection, file
317
00:21:25,372 --> 00:21:30,652
naming conflict resolution, and data loss
prevention, among others. So this allows
318
00:21:30,652 --> 00:21:37,272
you to, using a base folder, so for
example, pathbuilder::basestorage, you can
319
00:21:37,272 --> 00:21:42,472
add, uh, values using the add method. So
for example, if you wanted to provide a
320
00:21:42,472 --> 00:21:47,712
path for a user at email.com, you can say
that you want to use a sanitization
321
00:21:47,712 --> 00:21:52,012
strategy of hashed and then convert that
to a string. And this will give you the
322
00:21:52,012 --> 00:21:57,832
path location storage/ and then the hashed
value of the email address. It also
323
00:21:57,832 --> 00:22:02,312
allows you to create URL-friendly names by
using slugification or converting to
324
00:22:02,312 --> 00:22:09,212
snake case, and allows you to create, uh,
timestape- timestamp-based values
325
00:22:09,212 --> 00:22:14,812
for uniqueness. The package also includes
a Laravel integration with a facade. Uh,
326
00:22:14,812 --> 00:22:18,452
it also includes validation and security,
which automatically validates dangerous
327
00:22:18,452 --> 00:22:22,712
paths, as well as the possibility of
manually checking a path. Main features
328
00:22:22,712 --> 00:22:26,992
include it being a security first package,
built-in protection against directory
329
00:22:26,992 --> 00:22:30,912
traversal attacks. There is a fluent API
providing clean, readable path building
330
00:22:30,912 --> 00:22:35,592
with method chaining. Sanitization
strategies include hashing, slug, snake
331
00:22:35,592 --> 00:22:40,252
case, timestamp, as discussed. It is
immutable in its operation, which provides
332
00:22:40,252 --> 00:22:44,812
thread-safe path building with no side
effects. It uses the strategy pattern,
333
00:22:44,812 --> 00:22:48,672
meaning it has an extensible sanitization
system that you can contribute to
334
00:22:48,672 --> 00:22:53,212
yourself. There is full type hits and IDE
auto-completion, and a Laravel
335
00:22:53,212 --> 00:22:58,232
integration, of course, using the optional
Laravel storage facade integration. You
336
00:22:58,232 --> 00:23:02,452
can get started with this package. We have
links to GitHub and the documentation in
337
00:23:02,452 --> 00:23:05,612
-the show notes.
-Very cool. Yeah, we actually had to do
338
00:23:05,612 --> 00:23:10,332
something like this ourselves, where we
had to build this, um, sort of path
339
00:23:10,332 --> 00:23:14,811
builder out on a per tenant basis. So this
is really interesting. Uh, I'll be, uh,
340
00:23:14,812 --> 00:23:18,811
I'll be digging in on this one to kind of
figure out what pieces what maybe- might
341
00:23:18,812 --> 00:23:21,072
be able to pull out of this, or if this is
something we can sort of replace our own
342
00:23:21,072 --> 00:23:23,892
implementation with wholesale. This looks
really, really well done, so
343
00:23:24,512 --> 00:23:29,292
super cool. Uh, all right, let's talk
about Smartcache. So, if you've ever had
344
00:23:29,292 --> 00:23:34,332
to cache large payloads, this might be
something that you would want to look at.
345
00:23:34,332 --> 00:23:40,912
So the Smartcache package, uh, written by
Ismail Azaran, is a caching optimization
346
00:23:40,912 --> 00:23:45,792
package which is designed to enhance how
your application handles data caching. So
347
00:23:45,792 --> 00:23:50,252
it can intelligently manage large datasets
by applying optimization techniques like
348
00:23:50,252 --> 00:23:55,192
compression and chunking and more. So
think about if you had a large amount of
349
00:23:55,192 --> 00:23:59,292
data that you needed to cache. What this
will do is it'll take that large data, it
350
00:23:59,292 --> 00:24:04,628
will attempt to optimize it, and then it
will, after-... attempting to optimize it.
351
00:24:04,628 --> 00:24:09,018
It'll check the data size automatically,
and if it needs to, what it can then do is
352
00:24:09,018 --> 00:24:13,508
it can take that data and chunk it into
multiple pieces and store it in the cache
353
00:24:13,508 --> 00:24:17,628
in multiple pieces, and then it'll also
store that metadata alongside of it. And
354
00:24:17,628 --> 00:24:20,808
then when you go to retrieve it, it'll
look at that and say, "Do I need to
355
00:24:20,808 --> 00:24:24,208
retrieve multiple chunks? Yes, I do." Go
ahead and grab all those, decompress it,
356
00:24:24,208 --> 00:24:28,748
and then present it to you on the front
side. Um, so it basically just does all of
357
00:24:28,748 --> 00:24:32,448
that in the background for you. It has
driver-aware optimization strategies, so
358
00:24:32,448 --> 00:24:37,008
if you have to be using Redis or File or
databoy- database, it will handle
359
00:24:37,008 --> 00:24:40,628
different chunking and optimization
techniques based on that driver. So you
360
00:24:40,628 --> 00:24:44,148
can look into the README to see kind of
what's going on behind the scenes, but
361
00:24:44,148 --> 00:24:47,508
exactly what I described is what's
happening, checking data size, compressing
362
00:24:47,508 --> 00:24:51,708
or chunking it, storing that
optimization, uh, metadata for retrieval,
363
00:24:51,708 --> 00:24:57,368
and then reconstructing that on the, uh,
way out. So the API is very similar, uh,
364
00:24:57,368 --> 00:25:02,368
to Laravel's cache facade. The only thing
is that you use the facade smart-cache
365
00:25:02,368 --> 00:25:07,048
instead of cache.put, get, same things
that you're used to using with cache. So
366
00:25:07,048 --> 00:25:10,268
definitely check this one out if that's
something you're run into before.
367
00:25:10,268 --> 00:25:11,968
Yeah.
368
00:25:12,208 --> 00:25:18,988
The Laravel zxcvbn package is a validation
rule that estimates password
369
00:25:18,988 --> 00:25:21,448
strength using a PHP port of Dropbox's
370
00:25:22,088 --> 00:25:28,088
zxcvbn JavaScript package. It considers
using user inputs as well to determine a
371
00:25:28,088 --> 00:25:34,148
score for password guessability. You can
define a zxcvbn_minscore configuration
372
00:25:34,148 --> 00:25:37,768
value in your environment value to
determine when validation should fail and
373
00:25:37,768 --> 00:25:41,907
based on the scale provided by the
underlying package. Uh, the default is
374
00:25:41,908 --> 00:25:45,088
three, but depending on your needs, you
can configure it to match any of the
375
00:25:45,088 --> 00:25:48,628
following. I'm not gonna read through all
of the values zero through four, but zero
376
00:25:48,628 --> 00:25:53,328
means the password is extremely guessable.
It is a dictionary word like password or
377
00:25:53,328 --> 00:25:59,228
mother, and they will score a zero value.
Uh, all the way up to four, being very
378
00:25:59,228 --> 00:26:03,038
unguessable with the estimated number of
guesses in the order of 10 to the power of
379
00:26:03,038 --> 00:26:08,068
10, and provides strong protection from
offline slow hash scenarios. It is
380
00:26:08,068 --> 00:26:11,228
important to remember that Laravel has
excellent password rules out of the box,
381
00:26:11,228 --> 00:26:14,988
including the ability to ensure a password
was not present in a previous data leak.
382
00:26:14,988 --> 00:26:18,068
You can see the documentation for more
details, and we'll have links to this
383
00:26:18,068 --> 00:26:21,368
package in the show notes for you as well.
384
00:26:21,368 --> 00:26:26,168
Awesome. Let's talk about spies. So spies
many times is considered, uh, something
385
00:26:26,168 --> 00:26:32,468
that you would, uh, think about in context
of a testing environment, and this is not
386
00:26:32,468 --> 00:26:37,628
what we're talking about here. What we're
talking about is an HTTP spy. So the
387
00:26:37,628 --> 00:26:41,608
Laravel Spy package is a lightweight
package that will allow you to track and
388
00:26:41,608 --> 00:26:47,668
then log any outgoing HTTP requests in
your application. So you can launch this
389
00:26:47,668 --> 00:26:51,648
with zero config, uh, so you can just
install it, and it'll immediately start
390
00:26:51,648 --> 00:26:56,478
logging these requests. Uh, they could be
really useful for debugging and monitoring
391
00:26:56,478 --> 00:27:01,048
any external API calls that are made from
within your own application. But if you
392
00:27:01,048 --> 00:27:05,048
are a discerning developer, you might be
thinking of a couple of things that that
393
00:27:05,048 --> 00:27:09,948
could cause problems with immediately,
such as sensitive fields, right? If you're
394
00:27:09,948 --> 00:27:13,378
sending a request out and you have
sensitive fields that are a part of that
395
00:27:13,378 --> 00:27:17,248
request, wouldn't you want to obfuscate
those? And the answer is, of course you
396
00:27:17,248 --> 00:27:21,588
would. So that is where you do the
configuration. So you can configure which
397
00:27:21,588 --> 00:27:25,248
URLs are included that you're interested
in logging. Maybe you don't want to log
398
00:27:25,248 --> 00:27:29,988
every outgoing request. You only want to
log certain URLs that are going to be put
399
00:27:29,988 --> 00:27:33,788
into the log, and you can do that. You can
also ensure that sensitive fields are
400
00:27:33,788 --> 00:27:37,348
obfuscated by saying, "Here is the list of
fields I would like- make- like to make
401
00:27:37,348 --> 00:27:41,548
sure are not included in the logging." Or
if they are included, they're gonna be
402
00:27:41,548 --> 00:27:46,008
obfuscated so they're not usable by, um,
you know, dangerous folks that might be
403
00:27:46,008 --> 00:27:50,348
looking at your database. The package uses
a global middleware to accomplish this,
404
00:27:50,348 --> 00:27:53,388
and you can ensure that the requests are
cleaned up in production by using the
405
00:27:53,388 --> 00:27:58,408
included spy clean artisan command. And,
of course, Paul Redman, everyone's
406
00:27:58,408 --> 00:28:02,668
favorite human, is going to make sure, uh,
that he recommends that you configure
407
00:28:02,668 --> 00:28:07,088
this package to remove those sensitive
fields, uh, before you use this in your
408
00:28:07,088 --> 00:28:12,088
application. Really cool stuff there.
Thanks, Paul, for writing that one up.
409
00:28:14,028 --> 00:28:18,608
Notable is a Laravel package that adds
polymorphic note functionality to any
410
00:28:18,608 --> 00:28:22,508
eloquent model. It allows you to attach
notes and comments to models with creator
411
00:28:22,508 --> 00:28:27,328
tracking, timestamps, and powerful query
scopes. The package is helpful for any
412
00:28:27,328 --> 00:28:31,188
note-taking features you might need on a
model or for tools like auditing logs and
413
00:28:31,188 --> 00:28:34,968
user feedback. It includes powerful query
scopes, and you can easily add note
414
00:28:34,968 --> 00:28:39,608
support to a model using the hasNotables
trait, which will give you the ability to
415
00:28:39,608 --> 00:28:44,308
call the addNote method when a customer
adds a note. You can support agent
416
00:28:44,308 --> 00:28:50,088
responses in the context of a ticketing
system or a support system. Uh, you can
417
00:28:50,088 --> 00:28:53,388
get notes with creator to get the
conversation history. You get- can get
418
00:28:53,388 --> 00:28:57,608
notes from today, from this week, this
month in a given range of s- of dates, and
419
00:28:57,608 --> 00:29:03,228
you can search notes for a particular
message. Uh, polymorphic relationships
420
00:29:03,228 --> 00:29:07,928
allow you to attach notes to any eloquent
model. Tracking of who created each note
421
00:29:07,928 --> 00:29:12,308
is also polymorphic. Automatic created at
and updated timestamps are added for
422
00:29:12,308 --> 00:29:16,088
tracking of notes. There are powerful
query methods for filtering notes. It is
423
00:29:16,088 --> 00:29:19,928
configurable, so you can customize table
names through configuration. There is an
424
00:29:19,928 --> 00:29:24,888
easy integration using simple trace
bait... trait-based... trace bait?
425
00:29:25,908 --> 00:29:26,458
-Trade-based-
-Trace-based
426
00:29:26,458 --> 00:29:30,928
... implementation, and it is ready for
all of your Laravel applications from
427
00:29:30,928 --> 00:29:35,708
version 10 and above. We'll have links to
that for you in the show notes.
428
00:29:36,528 --> 00:29:37,068
Very cool.
429
00:29:37,748 --> 00:29:42,248
This is, uh, interesting one. This
package, I feel like I wished it existed
430
00:29:42,248 --> 00:29:48,868
way back in the day, um, and it may have,
because it's actually using Bootstrap
431
00:29:48,868 --> 00:29:55,148
5 behind the scenes. Um, so if you still
happen to be using Bootstrap, then this is
432
00:29:55,148 --> 00:29:59,308
great. Uh, if not, you might want to wait
a little bit before using this one,
433
00:29:59,308 --> 00:30:03,768
because tails- Tailwind CSS support is
coming soon. What exactly am I talking
434
00:30:03,768 --> 00:30:08,198
about?What we're talking about here is
Formelo. So Formelo is a level package
435
00:30:08,198 --> 00:30:12,988
that is designed to automate the
generation of forms. Instead of creating
436
00:30:12,988 --> 00:30:17,988
these forms manually with HTML, you can
leverage eloquent models to define the
437
00:30:17,988 --> 00:30:21,758
structure of those forms. So you can think
about, "Hey, here are the attributes that
438
00:30:21,758 --> 00:30:27,168
I have available to me for a eloquent
model." All that information can then be
439
00:30:27,168 --> 00:30:32,468
used to say, "I am going to create an HTML
form specifically for that eloquent
440
00:30:32,468 --> 00:30:36,468
model." Of course, that saves time, but
also ensures consistency across your
441
00:30:36,468 --> 00:30:39,508
applications. So, according to the
developer, Formelo was created for
442
00:30:39,508 --> 00:30:43,128
developers who need to generate forms
quickly without the overhead of a complete
443
00:30:43,128 --> 00:30:48,128
admin panel but who also want a simpler,
more intuitive API than complex form
444
00:30:48,128 --> 00:30:52,848
libraries. So the key features are that it
has easy form definitions using Laravel
445
00:30:52,848 --> 00:30:58,267
classes. So if you can write an array, you
can write a form definition. Uh, it will
446
00:30:58,268 --> 00:31:02,808
automatically render the form for you. It
has support for various field types, such
447
00:31:02,808 --> 00:31:08,028
as dates, text fields, text inputs, text
areas. Uh, it's got customizable widgets
448
00:31:08,028 --> 00:31:12,668
as well as mel- uh, as well as automatic
error handling, and displaying and form
449
00:31:12,668 --> 00:31:16,348
validation integration, as I mentioned
before. Bootstrap 5 by default, but
450
00:31:16,348 --> 00:31:21,348
Tailwind CSS is coming soon. So, the mini
version of the tutorial here is that if we
451
00:31:21,348 --> 00:31:27,208
have an article, for example, you could
create an article form that extends
452
00:31:27,208 --> 00:31:31,648
Formelo, and what you're gonna have there
is a create method, you're going to have
453
00:31:31,648 --> 00:31:36,348
an edit method, and then you're gonna have
a fields method. So, create, uh, and edit
454
00:31:36,348 --> 00:31:41,148
are going to define what type of verb
it's gonna be, post or patch, uh, the
455
00:31:41,148 --> 00:31:44,408
action, the route where it's going to send
that stuff, and then the fields, of
456
00:31:44,408 --> 00:31:49,048
course, is just what you would think. Here
is the name of the field, here is the
457
00:31:49,048 --> 00:31:53,208
value it's gonna be coming through as, and
then here is the label that you're going
458
00:31:53,208 --> 00:31:56,568
to have. If it's a select, of course,
you're gonna have something like choices,
459
00:31:56,568 --> 00:32:00,088
um, et cetera. So if you already have a
model, you can use an artisan command to
460
00:32:00,088 --> 00:32:04,848
generate this field for you automatically.
You just artisan make formelo, and then
461
00:32:04,848 --> 00:32:09,068
pass along the model, model=article. It
will go ahead and do its very best to
462
00:32:09,068 --> 00:32:12,768
guess which fields you're going to need
there. It's gonna generate that form for
463
00:32:12,768 --> 00:32:17,227
you, and then you can use that by
rendering the form inside your blade.
464
00:32:17,228 --> 00:32:20,808
What's that look like? Inside of your
controller action, you're going to new up
465
00:32:20,808 --> 00:32:24,568
that form class that was just created for
you. You're gonna pass that through to
466
00:32:24,568 --> 00:32:28,168
your front end blade. Uh, there is a
little bit of work you're gonna have to do
467
00:32:28,168 --> 00:32:31,908
to set up. Uh, they're going to say,
"Include Bootstrap 5 assets," make sure
468
00:32:31,908 --> 00:32:35,148
you do that. But also, you're gonna have
to include the formelo styles and scripts
469
00:32:35,148 --> 00:32:38,708
using two directives that are included
inside of the package. And then all you do
470
00:32:38,708 --> 00:32:40,308
is you $form
471
00:32:40,928 --> 00:32:44,828
render. So that's it. Uh, really, really
simple there, and then it's gonna go ahead
472
00:32:44,828 --> 00:32:49,288
and generate the HTML that would be
necessary in order for you to see those
473
00:32:49,288 --> 00:32:54,248
form values on the front end there. Um, so
looks pretty interesting. I- I've not
474
00:32:54,308 --> 00:32:58,788
seen what the form looks like on a front
end. I don't know how customizable that
475
00:32:58,788 --> 00:32:59,908
is, um,
476
00:33:00,968 --> 00:33:03,828
but if you're just looking for something
sort of quick and, like, "Hey, we need
477
00:33:03,828 --> 00:33:07,368
just something that, that works," and- and
whatever, and it's maybe internal use,
478
00:33:07,368 --> 00:33:11,508
I'm not exactly sure, may- maybe this
works great for you. Uh, again, it doesn't
479
00:33:11,508 --> 00:33:14,708
have a whole lot to say about the
customizability of the forms that it's
480
00:33:14,708 --> 00:33:18,948
creating. Um, maybe it does, maybe it
doesn't. I'm not sure. But, um, in any
481
00:33:18,948 --> 00:33:23,148
case, seems like an interesting project.
So, check that one up. Thanks, Yannick,
482
00:33:23,148 --> 00:33:23,808
for writing that one up.
483
00:33:24,588 --> 00:33:29,688
Yeah. Looking, looking at the, the GitHub,
the README for it says that it is a
484
00:33:29,688 --> 00:33:33,328
comprehensive form generation and handling
tool for Laravel applications that is
485
00:33:33,328 --> 00:33:35,068
inspired by Django Forms.
486
00:33:35,868 --> 00:33:39,548
Um, so it has built-in support for
Bootstrap 5 and support for Ta- Tailwind
487
00:33:39,548 --> 00:33:45,628
CSS is coming soon. So, at the moment, it
looks like, uh, Bootstrap Form, so maybe
488
00:33:45,628 --> 00:33:49,148
if you need it for your Laravel
applications that are using Tailwind at
489
00:33:49,148 --> 00:33:54,168
the moment, hold off for the time being.
But it does give you the ability to, uh,
490
00:33:54,168 --> 00:33:57,648
publish assets and things like that, so
it's entirely possible that you can
491
00:33:57,648 --> 00:34:01,328
re-styler these things yourself. But, uh,
keep an eye out on that, because, you
492
00:34:01,328 --> 00:34:04,888
know, we love a form builder. Makes life
nice and easy.
493
00:34:04,888 --> 00:34:09,088
-Sure does.
-Okay. Tutorial time. We have four
494
00:34:09,088 --> 00:34:14,787
tutorials. We have, uh, five framework
reminders this week, and we spoke last
495
00:34:14,788 --> 00:34:18,238
week about the video series on, um,
496
00:34:19,548 --> 00:34:22,887
better... What- what- how did we, how did
we term it? Let's have a look at the show
497
00:34:22,887 --> 00:34:26,967
notes last, last time. We was talking
about, um... Oh, I just put a link to
498
00:34:26,968 --> 00:34:32,928
Twitter, which doesn't help. Um...
Advanced Eloquent Mastery is the series
499
00:34:32,928 --> 00:34:38,328
that, um, Harris was building, and he has
released now the first episode of that. So
500
00:34:38,328 --> 00:34:44,008
let us go through, uh, first off, the
tutorials. Uh, first cab off the rank,
501
00:34:44,008 --> 00:34:48,048
adding autocomplete to your Laravel
application. So if you've ever had to
502
00:34:48,048 --> 00:34:52,228
implement a search feature that has become
hugely important for most applications
503
00:34:52,228 --> 00:34:57,408
these days, uh, make sure that you are
valuing user experience so that users can
504
00:34:57,408 --> 00:35:01,508
search what they need to see without
scrolling endlessly. In this tutorial,
505
00:35:01,508 --> 00:35:05,068
written by Abdulrazak, uh, Jamiu-Ideye,
506
00:35:06,028 --> 00:35:10,188
we will build a movie application that
leverages MongoDB's Atlas Search with
507
00:35:10,188 --> 00:35:15,628
Laravel to build a rich text, uh, rich
text-based search feature that allows
508
00:35:15,628 --> 00:35:19,788
users to search for movies by typing a few
letters.
509
00:35:21,588 --> 00:35:23,488
Do you wanna take the rest or do you want
me to just fly through them all?
510
00:35:23,488 --> 00:35:24,988
No, I'll- I'll go for the next one too.
Yeah.
511
00:35:24,988 --> 00:35:25,798
-Perfect.
-I'll- I'll get the next one.
512
00:35:25,798 --> 00:35:28,296
-Okay.
-No problem. Um...And the next one we're
513
00:35:28,296 --> 00:35:34,555
looking at is the implementation of user
confirmation dialogs in Laravel Livewire
514
00:35:34,556 --> 00:35:40,555
with the wire confirm property. So, uh, if
you've ever had to do this before, you
515
00:35:40,556 --> 00:35:44,796
know, sometimes you reach for the default
confirmation dialog that you get with
516
00:35:44,796 --> 00:35:49,356
JavaScript, which is very simple and works
really well, but it's not super
517
00:35:49,356 --> 00:35:53,316
stylistically matching to maybe the rest
of your UI, right? It just feels a little
518
00:35:53,316 --> 00:35:57,695
bit clunky sometimes. It's a native a- uh,
you know, native JavaScript API, and so,
519
00:35:57,696 --> 00:36:01,936
eh, it, it's okay. But Livewire provides
developers with an intuitive approach to
520
00:36:01,936 --> 00:36:06,256
implementing these confirmation dialogs
with this wire confirm directive. So, uh,
521
00:36:06,256 --> 00:36:10,676
this feature addresses that common need
for preventing accidental execution of the
522
00:36:10,676 --> 00:36:14,756
critical operations, like deleting
things, uh, while also maintaining your
523
00:36:14,756 --> 00:36:18,976
code to be clean and declarative. So this,
uh, tutorial is gonna go through how you
524
00:36:18,976 --> 00:36:23,196
can use that wire confirm directive
seamlessly so that your code continues to
525
00:36:23,196 --> 00:36:28,496
stay clean and you get all the benefits of
those confirmation dialogs. I will say
526
00:36:28,496 --> 00:36:34,716
that, uh, Flux has also been a godsend.
We've been using, uh, Livewire Flux, and
527
00:36:34,716 --> 00:36:39,596
it has really been absolutely gorgeous and
really nice to work with. So if you're
528
00:36:39,596 --> 00:36:43,756
looking, um... You know, this tutorial is
excellent, for sure, but if you're looking
529
00:36:43,756 --> 00:36:48,326
for something that looks beautiful,
functions really well, and is just, uh,
530
00:36:48,326 --> 00:36:51,676
really a pleasure to use straight outta
the box, you should definitely check out
531
00:36:51,676 --> 00:36:55,216
Flux. A lot of hard work and effort has
been put into that by Caleb and the team
532
00:36:55,216 --> 00:36:58,816
there, uh, at Livewire, so definitely
check that one out, as well as this
533
00:36:58,816 --> 00:37:01,396
tutorial. Thanks, Harris Refotopoulos, for
writing this one up.
534
00:37:02,236 --> 00:37:08,836
Yeah. Uh, what have I got here next?
Optimizing Laravel Livewire performance
535
00:37:08,836 --> 00:37:14,036
with computed properties. Uh, so this is
something that, that was, I think, in
536
00:37:14,036 --> 00:37:18,016
like, Livewire version two, it was a bit
problematic, where it would always have to
537
00:37:18,016 --> 00:37:20,856
compute. If you were returning
collections and things like that, it would
538
00:37:20,856 --> 00:37:26,676
have to keep doing these things all the
time. Now Livewire provides you with a
539
00:37:26,676 --> 00:37:32,116
computed attribute that you can attach to
your methods, and they will expose these
540
00:37:32,116 --> 00:37:37,596
things in such a way that they're not
recalculated every time your component is
541
00:37:37,596 --> 00:37:41,866
re-rendered in the browser. So, uh,
definitely check that out if you have ever
542
00:37:41,866 --> 00:37:45,716
run into, you know, the mysterious
performance issues of your Livewire
543
00:37:45,716 --> 00:37:47,806
components before.
544
00:37:48,696 --> 00:37:53,116
Okay, last tutorial before we get into the
framework reminders. This is by Samuel
545
00:37:53,116 --> 00:37:57,496
Stancil, really, really smart dude. And
the title of this one is Using SQLite in
546
00:37:57,496 --> 00:38:03,116
Production with Laravel. So, SQLite is the
actual default, I believe, now for
547
00:38:03,116 --> 00:38:06,836
Laravel. When you spin up a new
application, it uses SQLite by default,
548
00:38:06,836 --> 00:38:10,446
and it is a really good database for many,
if not most Laravel applications
549
00:38:11,116 --> 00:38:14,316
when it's well configured. And that's sort
of the trick, right? We're gonna get to
550
00:38:14,316 --> 00:38:18,296
that, uh, but it can provide great
performance even if your app has a lot of
551
00:38:18,296 --> 00:38:23,496
concurrent requests. But why would you use
it over MySQL? When is SQLite going to be
552
00:38:23,496 --> 00:38:29,056
the best for you? Uh, what are the main
benefits of SQLite? Um, et cetera, et
553
00:38:29,056 --> 00:38:33,656
cetera, and on you go. So, what do you
need to be aware of when you're wanting to
554
00:38:33,656 --> 00:38:37,256
use this in production? Do you need to
use something like Turso, which is like,
555
00:38:37,256 --> 00:38:41,716
hosted SQLite? So, if you've been
interested in using SQLite in production
556
00:38:41,716 --> 00:38:44,696
and you want to know sort of the gotchas
or the things that you need to be aware of
557
00:38:44,696 --> 00:38:48,056
before deploying this as your production
database, you should definitely give a
558
00:38:48,056 --> 00:38:51,935
look through this tutorial. It's gonna
talk about the different modes, uh, for
559
00:38:51,936 --> 00:38:57,726
SQLite that allow you to unlock really
good potential performance, um, as well as
560
00:38:57,726 --> 00:39:02,656
like, rollback mode, data types that you
can use inside of SQLite, um,
561
00:39:02,656 --> 00:39:06,536
transactions. By default, transactions
don't acquire locks until you need them,
562
00:39:06,536 --> 00:39:10,616
for example, so how do you make sure that
that's all set to go? Um, and, and just a
563
00:39:10,616 --> 00:39:15,076
couple other pieces that you would want,
uh, if you were deploying this. So, recap.
564
00:39:15,076 --> 00:39:20,356
Using wall mode, mindful of data types,
uh, use this override, uh, that he
565
00:39:20,356 --> 00:39:24,816
includes here only until PHP 8.5, but
something you need to be aware of in any
566
00:39:24,816 --> 00:39:28,316
case. So, definitely check that one out if
SQLite is something you've played around
567
00:39:28,316 --> 00:39:32,296
with and you'd like to deploy that to your
production application. Uh, a couple
568
00:39:32,296 --> 00:39:36,306
things you're definitely gonna want to be
aware of in that case. Thanks, Samuel, for
569
00:39:36,306 --> 00:39:39,376
writing that one up. And we've only got
framework reminders left, my friend, so
570
00:39:39,376 --> 00:39:44,155
I'm gonna let you roll through there, and
then we've got a video to cap off the end
571
00:39:44,155 --> 00:39:47,056
here. Um, and I'll let you take that one,
too.
572
00:39:47,056 --> 00:39:53,556
Perfect. So, our five framework reminders
this week. First up, enhanced queue job
573
00:39:53,556 --> 00:39:58,016
control with Laravel's
throttlesExceptionsFailWhen method. We
574
00:39:58,016 --> 00:40:03,316
have streamlining application automation
with Laravel's task sched- scheduler,
575
00:40:03,316 --> 00:40:06,656
Laravel's enhanced string validation with
inverse methods,
576
00:40:07,356 --> 00:40:10,656
building cross-platform alerts with
Laravel's notification framework, and
577
00:40:10,656 --> 00:40:16,016
preserving data integrity with Laravel's
soft deletes for recovery and compliance.
578
00:40:16,016 --> 00:40:20,396
This is your homework for this week. It's
always good to keep an eye out for
579
00:40:20,396 --> 00:40:25,216
Harris's, um, framework reminders where,
you know, we will talk about things at a
580
00:40:25,216 --> 00:40:28,736
very high level, we will say, "This new
feature has been introduced in this new
581
00:40:28,736 --> 00:40:34,116
release of the framework." Harris goes and
spends a lot of time going through these
582
00:40:34,116 --> 00:40:38,256
kinds of things and fleshing them out,
providing more content, providing, uh,
583
00:40:38,256 --> 00:40:43,056
visual aids, providing code examples and
usage examples, and things like that, that
584
00:40:43,056 --> 00:40:47,556
we just don't have the capacity or the
ability to do on the podcast without
585
00:40:47,556 --> 00:40:51,856
dragging each episode out to longer than
it needs to be. So, definitely check those
586
00:40:51,856 --> 00:40:56,656
out. Keep your eyes peeled. It was great
to catch up with and meet, uh, Harris
587
00:40:56,656 --> 00:41:01,526
face-to-face in Denver, uh, about a month
ago now. So, uh, definitely check him out.
588
00:41:01,526 --> 00:41:06,996
He's a great guy and does some wonderful
work. And speaking of Harris, as I said,
589
00:41:06,996 --> 00:41:12,016
he's started his, uh, new series. I
believe it's been renamed now to Laravel
590
00:41:12,016 --> 00:41:17,156
in Practice. The first video, nine minutes
in length give or take, talks about
591
00:41:17,796 --> 00:41:21,176
you, uh, how you can stop writing a bad
controller. So, we've all written a
592
00:41:21,176 --> 00:41:24,735
controller, the one that's got, you know,
15 lines of business calculations that
593
00:41:24,736 --> 00:41:28,996
you've copied to three different places.
In this latest, or this first video, he
594
00:41:28,996 --> 00:41:32,616
shows how Laravel's custom collection
methods can transform these messy
595
00:41:32,616 --> 00:41:35,176
controllers into clean, reusable code
596
00:41:35,816 --> 00:41:40,136
that actually makes sense. This is a
series that he's publishing on
597
00:41:40,756 --> 00:41:43,806
our YouTube channel. We have links to that
for you in the show notes so you can, uh,
598
00:41:43,806 --> 00:41:50,156
like, subscribe, hit the bell, do all the
things, uh, and keep your eyes out for
599
00:41:50,156 --> 00:41:51,156
that series.
600
00:41:52,516 --> 00:41:56,236
Excellent. Folks, that wraps us up,
episode 244. Thanks so much for hanging
601
00:41:56,236 --> 00:42:01,636
out with us. You can find show notes for
this episode at podcast.laravel-news/244.
602
00:42:01,636 --> 00:42:04,276
If you liked the show, we would really
appreciate it if you'd rate it up in your
603
00:42:04,276 --> 00:42:07,196
podcatcher of choice. Five stars would be
absolutely incredible. And of course, if
604
00:42:07,196 --> 00:42:10,216
you have any questions or comments, we'd
love to hear from you on Twitter, on X, on
605
00:42:10,216 --> 00:42:13,336
Bluesky, all of the places,
@MichaelDerenda, @JacobBennett, or
606
00:42:13,336 --> 00:42:19,236
@LaravelNews. All right, folks. Two weeks
now, two weeks later, two weeks from now.
607
00:42:19,236 --> 00:42:21,696
We'll see you then. See ya.
608
00:42:21,696 --> 00:42:47,076
Bye.