This is the Laravel News Podcast, your one-stop podcast to find out about
Laravel-related news, tutorials, packages, and more. Here are your hosts, Jake
Bennett and Michael
Dyrynda.
Hello, friends and neighbors and loved ones. Welcome to Laravel News. This is
-episode... -244.
244, folks. It has been, uh, a bit of a rough start for us. Let's... I- I'm not
gonna beat around the bush here. Okay? I was supposed to be on this call 26 minutes
ago, and I woke up 12 minutes ago
because... You know, I- I don't know, dude. I'm not sure if it's that time of
year. I honestly do not know. It has been-
-No idea -... this week, I have been so
tired. Yesterday, I was, like, I was in bed early
and, like, woke up late this morning and then another... Like, just exhausted. I'm
not sure if it's, like, the time, like, you know, changing of the seasons. I have
no idea. My kids are feeling it too, though. Dude, I don't know. So-
-Possibly. -Thank you.
-I am. -Yeah.
It was interesting listening to
Ian Landsman on The Mostly Technical Podcast talking about, you know,
having showers at night versus in the morning and how, because he has hay fever,
-he showers before night to, like- -Oh
... make sure all of the pollen is out of the hair, so then you're not sleeping and
rolling around in the pollen. And it's, it's definitely getting to that time of
year where we're, we are definitely getting the fits and starts of spring. So
it was sunny yesterday, it rained this morning, but the sun's out today. Um, you
know, we're losing the, the undergarments now. We're, you know, no more singlets,
just long sleeves. It's supposed to be warm on, on the weekend. So, uh, all of
this is fantastic, but it also means that the pollen is coming. And this-
-Mm-hmm, mm-hmm -... I cannot abide because- ... I'm, I, I
long for the days when I didn't have hay fever, and now it's quite severe. So time
-to start loading up on antihistamines. -That's right. That's right. It is coming
whether you want it to or not. So folks,
welcome to the show. And, uh, I'm glad you're here. I'm glad to be here. Today is
September 3rd, 2025. We are gonna get into it with releases, with news, with
packages, with tutorials,
as always. So
let us start at the very top with releases. I'm gonna be talking about
Laravel
12.26.
Soon as I get my- ... video in the right place. There it is. Okay. Here we are,
folks. Laravel 12.26 released the week of August 26th, which has a withHeartbeat
method to LazyCollections, a toPrettyJSON method to Collections, Models, and more,
et cetera. Let's start with React and Vue Starter Kits, which now include Wayfinder.
So Joe Tenenbaum updated the Laravel React and Vue Starter Kits to include a
Laravel Wayfinder. What is Wayfinder, you might ask? Wayfinder provides a type-safe
bridge between Laravel Routes and your front end. If you've ever used Ziggy
before, uh, Wayfinder is Ziggy improved. It is Ziggy plus. Uh, it does a
lot of amazing things. It makes the pieces of your back-end application available to
your front end in a type-safe way. Not only Routes, but lots more. So you should
definitely check that out. And it totally makes sense that it would now be included
in the Vue Starter Kits and React Starter Kits because that's where it's going to be
most powerfully used. Right? So there you have it added to the Starter Kits.
withHeartbeat method has been added to LazyCollections. Joseph Silver contributed
the new withHeartBeat method to LazyCollections, which allows you to run a
callback at regular intervals while the collection is being lazily enumerated. So
his primary use case that he shared in the pull request is stated as such. In
long-running tasks, such as bass- batch processing por- reports, you may need to
hold a lock to prevent concurrent execution. However, if the code
unexpectedly fails to release the lock if you don't want it to persist indefinitely.
So a common strategy is to acquire a short-lived lock, and then you
periodically extend it while the task is still running. So an example is ac-
requiring the lock for five minutes, then re-acquiring it every four minutes,
assuming that a report never takes a full minute to generate. So instead of saying,
"I'm going to lock that program indefinitely
and then my, uh, I will unlock it once my task is done running." Like, you can think
that, uh, when you do commands that are in the background, Laravel will do this
actually. It will take a mutex, and it will store that mutex in the cache, and it
will check itself to see
if that command has finished yet. And if it hasn't, it won't allow it to overlap.
Right? There might be some reason why you'd wanna do a lock like that. Well, in
this case, instead of setting it for forever, just say, "Nope. We're just gonna
leave... Have it for five minutes. We'll release it after that. And then every four
minutes, we'll make sure that we reacquire that lock." So yeah, really
interesting. The documentation's been updating to include this, uh, in dup-
sorry. Has been updated to include this section about that new withHeartBeat
method, but that's an interesting one there. Thank you, Joseph Silver.
PrettyJSON method. Wendell Adriel contributed a toPrettyJSON method. What
this does is it will, um, it will be implemented in all the places where the
toJSON method exists. So for example, collections, models, JSON resources,
paginators, et cetera. Uh, an example...From full request 56697 using
collections where it previously would've had collection error to JSON, you can now
say to pretty JSON. So, um, you know, we're all used to seeing the, the nasty
output and then you copy and paste it over into Sublime and you say, "Set the syntax
-to JSON," and pretty- -Full map
-... you know, print sort of deal. -Mm-hmm.
You don't have to do that anymore. It will just do it. You can do to pretty JSON.
It'll give you a nicely formatted output there, uh, that is now available. Folks,
that is the diff there for f- uh, version 12.26. Of course, you can see the full set
of release notes on GitHub, if you care to. That's a good one. All right, dude.
-Over to you. -Laravel 12.27 introduced things such as
support for the SQS FIFO queue message group IDs, uh, which unlocked the ability
to utilize Amazon's Fair Queue feature in SQS. Uh, we'll talk about that and more
now. Nior Mohammed Zaki, one of the Laravel core team, contributed support for
FIFO queue message group IDs. As mentioned, this enables Laravel SQS queue
driver to utilize Amazon's Fair Queue feature. The Laravel documentation has
been updated in kind with details on this and fair queues, and you can see the
Amazon SQS documentation for more about them as well. Casey Dwyer contributed the
ability to prepend the count when using the string plural method. So, often we've
done this thing where we wanted to say, like, number and then the string plural
and then, you know, then we pass the count again and we do the thing. Now you can
pass a third argument to the string plural method, which is a Boolean flag
defaulting to false to preserve backwards compatibility, which will automatically do
this for you so you don't need to do the concatenation dance there. So thank you,
Casey Dwyer, for that one. Uh, Jake just spoke about the pretty JSON functionality
that was added in Laravel 12.26. Lucas Michaud contributed the ability to pass
additional parameters to the pretty JSON method, giving developers more control
over encoding when using this method. Uh, so this is a unary
type that you can pass through with a bunch of PHP-defined options that allow
you to manipulate what that pretty JSON looks like. Obviously by default it is to
format it, but you can also pass, uh, parameters to do things like, uh,
unescaped Unicode characters and so on. So thank you to Lucas for that. And last up
in our notes here, Jesper Nordset contributed support for enum values in
collection countBy and groupBy methods by converting them to strings or ints as
array keys. So we've seen backed enums throughout the framework, uh, everywhere,
so this allows you to do countBy key and then pass
enums directly into those, um, arrays as values and it will handle the casting to
n- numeric values for you when you call something like all, for example. But also
giving the ability to implicitly count without having to pass a, a closure and,
and handling that for yourself manually.
That's all we have for releases this week.
All right, folks. Um, this is not a Laravel release, but it is a release
nonetheless. And we are so excited about it, we actually have it listed twice in
our show notes, which is that Pest 4 has now been officially released. So this is
going to allow you to get started if you... Let's, let's back up. In case
you've been living under a rock for the last couple years, Pest is a
new and improved
version of PHPUnit. Can I say that? I think so. It's built on top of PHPUnit.
Pest 4 is in fact built on top of PHPUnit 12. Um, it's a superset of that, right? So
it runs on PHPUnit but it allows for this beautiful syntax. Um, it takes care of a
lot of the things. It's, it's actually not, um, Laravel specific, right? It's not
locked to Laravel, it's, it's available for use in, uh, other testing
environments. Anything where you would use PHPUnit you could use Pest. Really,
really good stuff. Was, what, what's different about Pest 4 that we care about?
Let's talk about that. So, the big thing about Pest 4 is browser testing. So this
is, um, the brand new feature that's unlocked allowing you to run tests in your
browser using
not the old one. Uh, what was the old one? I'm trying to remember. It's like, you
know, we use Chromeless, uh, browser. What was it?
Yeah, it was browser... Eh, not browser. Dusk.
-Headless, headless Chrome browser. -The headless... Yeah, it was-
-Yeah, it was Dusk- -It was-
... but I'm trying to remember what the, uh... There was, like, Selenium, which was
-the old school one. -Chromium, wasn't it?
-Right? Yep. Yeah. -Is this what you're looking for?
So there was like Selenium, which was old, old. And then you would use, like,
Chromium, right, version. Like this headless browser Chromium sort of deal.
-Mm-hmm. -This uses Playwright. So Playwright is a
new version of, uh... We- we've talked about it on the show before, right? But it
basically is a new and improved version of
the old
headless Chrome browser. I, again, I'm, I'm oversimplifying here, right? There's a
lot of amazing benefits that we've talked about for why Playwright is, uh, a great
choice moving forward. Um, but Nuno has done the hard work of wrapping up all
those APIs and building them into Pest so that you can continue to use your new PHP,
uh, your new favorite PHP testing framework, Pest, um, with Playwright. So
really, really cool stuff here. So let's talk about what that is. End-to-end
browser testing. You also have visual testing, so you can get visual diffs.
Device testing, so you can say on iPhone it should look like this, on desktop it
should look like this. Uh, code coverage with browser and unit tests. You can also
launch a tinker session mid-test, which is really, really cool. Um, you can have
test sharding, so, like, across your, um, CI actions. So you
have this idea that you can run
things in parallel, right? Um, you could always do that with PHPUnit or with
Pest.... really difficult to accomplish browser tests. Um, but Pest will help with
that and will allow you to run more than two instances in parallel by doing
sharding, which basically means it will take your test suite, it will break it up
into however many groups of things you want to run, and then you can run those
all at the same time across different actions. So previously, because with
GitHub Actions, you only have two processors at max that you could use for
their test runners, you could only run two instances of parallel at a time, right?
With sharding, you can say, "I wanna run eight," and it'll spin up four different
GitHub Action runners, and will allow you to run all of those at the same time.
Really, really cool stuff, uh, and allows your test suites that used to take 30
minutes down to, like, five minutes. Right? Uh, so there's a whole official
announcement post if you were not able to catch, um, Nuno's release of Pest 4 live
on stage at Laracon this year. We also have a link to that, so you can watch that
on YouTube. So lots of really, really cool stuff. There is an announcement post
that kind of goes over all the different things that I just talked about with far
more detail. And then there's also an upgrade guide that was gonna allow you to,
uh, go from Pest 3 applications to Pest 4 applications. And then lastly, I wanted
to mention that Jason Mercuri, uh, Laravel Shift, has created a, a Dusk to
Pest ta- uh, conversion, and so you can run that as well. That will attempt to
take your Dusk tests and convert them over to your Pest v4 browser testing, uh,
paral- uh, you know, browser testing equivalents. So good stuff on that. Lots
of options there, lots of ways to get started, and really, really exciting, uh,
-exciting stuff there. -Well, sure. Uh, I wanna say two things
about sharding. Number one, the way you say it, uh, is very close to dangerous. So
-just, uh- -Sharding
-... just be careful there. Sharding. -How- I, I know.
-Uh- -Like, it is a weird, it is a weird word. I
don't know how else you would sa- shard? Is it sharding? How would you say it?
You say shard. But, see, well, it... The D very-
-I want, I want you to give me- -Comes close to a T
-... the good version of it- -Sharding.
-... and I want you to give me the bad- -Sharding
-... version of it. -See, we, we, we... So there's, there's
-sharding, right? But if- -Sharding.
-The way- -Sharding.
The way, the way you sha- sharding, the way you say sharding, it, it, it, it
crosses into dangerous- ... inappropriate territory. So I just wanted to say that,
-number one. -We need to have, like... We need to have,
like... You know how, like, I say beta and you say beta?
-Yeah. -Like, beta testers or whatever.
-Uh-huh. -Like, we need to have an equivalent for
this word. Is it, like, uh, I don't know. Like, how do you say it differently? I
-don't know. -I, I don't think there's, there's an
-answer. I just think it's, uh... Anyway. -Sharding.
-But- -Maybe sharding.
Sharding. So as part of, uh, some work that I'm doing at the moment, I did
upgrade our code base from Pest3 to Pes- Pest4, which was mostly a straightforward
transition. Obviously, Pest4 requires PHP unit version 12, which we had some-
Okay, yep
... you know, interdependent issues, you know, dependency of a dependency of a
dependency that we have forks of to, to keep alive because they technically only
work for Laravel 6, and we're on Laravel 11.
Um, but using the shard functionality inside of GitHub Actions took our test
run... Like, it halved our test runtime. So it's-
-Wow. That's incredible, yeah -... we've split our suite up into five.
And so each shard runs for about two minutes. So our-
-Okay -... total cumulative runtime for our test
is about seven and a half minutes now, where it was 16 before. So it's a-
-Wow. That's amazing -... it's a huge improvement, um-
-Yeah -... just, just by turning that on. And
then, obviously, we've got, you know, caching between, um, different test
executions and things like that. But it's, uh... I, I haven't even looked-
-That's amazing -... at the Playwright stuff yet. Uh, I
know that our front end guys did a bit of work to convert all of the Cypress tests.
Like, this was already underway before Pest4 was announced, so rewriting our
Cypress test into Playwright. But now that Pest supports Playwright-
-Yeah -... uh, on the back end, we can, we can
now do more comprehensive end-to-end tests as well, which, which I'm really looking
forward to. I think that will really, um, you know, for us specifically, but for the
community at large, it's gonna make testing those things, making them robust,
much, much more powerful across the board.
Absolutely. Yep. Super excited. I, I can't wait to, to get in there and try it. Uh,
we've got a couple things that we're prioritizing before we head to that, uh,
as the next list on... or next item on the list. But we will get there. We have no
doubt we will get there and, uh, take advantage of that. Super excited. I'll
-keep you updated. -Mm-hmm. Yeah. Uh, the Laracon Australia
2025 talk titles have been revealed. They're up on the website at
laracon.au/schedule, and we have placed all of the titles up there. And so whilst
the speaker lineup has been announced, uh, already earlier this year, the talks
themselves have until now been a mystery. And for an extra twist, we're not going to
link the speakers
with their talk titles until next month, which gives the opportunity, a chance to
guess who's presenting what topic. And to make it fun for attendees, we're running a
giveaway. If you can guess the correct pairings for each of the talks, you could
win one of our very special limited edition hoodies to collect if you are
attending in Brisbane this November. Entries close Sunday the 14th of November
at 11:59 PM Eastern Standard Time. Uh, anyone can play this, of course, but only
a, uh, attendee will be able to collect the prize. This year's theme is Level Up,
and the program reflects a wide range of topics for developers looking to push
their skills further. Tickets are still available, including a limited allocation
of early bird tickets, which are now open to both individuals and small teams of up
to four per, per transaction. And premium, bundle, and community sponsor tickets are
still availble- available, along with group discounts for larger teams, which
you can grab at laracon.au/tickets.
Very good. Okay. So I'm gonna... Uh, I... That one, is that under news? Because I
think it must have replaced one of the other links or something. I wanna make
-sure- -Okay
... I'm in the right spot and not skipping.
-Oh, yes. It is under news. I, uh- -Okay
-... must have put the- -Okay. Gotta fix it
... wrong thing into the Notion document. I will fix now.
Not a problem. Not a problem at all. Okay, folks. We are gonna move on to packages,
shall we? So-Let's talk about ownership relationships between eloquent models with
Laravel ownable. Michael, I feel like you might have had something like this back
in the day. Did you have your own package that sort of did something like this?
Yes, I had something similar. It was- it was much less comprehensive. Like, it was
just
an owned by thing, which, you know, you can realistically do using
-Eloquence's method now. -Sure.
Yeah.
Sure. So, let's talk about this package. Um, Michael used to be a prolific package
author back in the day. In fact, that is the story of how we met. Uh-
-Mm-hmm. -Michael had an amazing nullable fields
package, which just fit the bill for something I needed, and I was using it all
the time. And every time I used it, I was like, "Michael, dude! This is so awesome.
Thanks for making this." And I was like, "Hey, should we start a podcast? We should
definitely start a podcast." "Are you going to Laracon?" I'm definitely going to
Laracon, yeah. It's the start of a beautiful relationship, and it's been-
-Long- -What? Like, eight years now?
-It's 10 years. Be 10 years next year. -10 years? Dang. 10 years. Crazy, crazy.
So, anyway, let's talk about ownership relationship packages. All right, Laravel
Ownable package created by Abdulla Sawaliam, provides a flexible and
straightforward way to manage ownership of any model by another model in your
Laravel application. So, uh, a user might own, uh, another user in a
manager-employee or manager-team member sort of relationship. Uh, you might have a
user that owns a blog post, or a blog post that belongs to a user. Uh, key
features of this package would be flexible ownership, meaning any model can own any
other model. You can transfer ownership between different owners. You can also
keep track of those ownership changes over time. Think like a ownership history log.
You can easily retrieve the current owner of any ownable item. You can check the
ownership status and manage multiple ownables in bulk operations. It will
automatically clean up ownership records when models are deleted, so it'll take
care of, like, that cascading problem there. And then it also has facade
support, you can use the convenient owner facade for ownership operations. So,
there's some example usages in here. Uh, it's- it's quite simple, where you are
going to implement an owner contract. You use a trait of 'has ownables' and then you
have a 'is ownable', uh, trait that you can use in an ownable contract for the
other side of that relationship. So we have a user, which has a owner contract,
and then you have a task, which is a ownable contract. So with those two things
in place, then you can say, "User, give ownership to task." So you could say, you
know, in very plain English, "Giving a user ownership of a task," or you can
transfer that to another user. You can get the current user. You can remove
ownership, just as you would assume. Uh, but it's very, very simple. The API looks
really nice there, and you get all those things we talked about along with that,
right? The ownership history, transfer operations, bulk operations, et cetera. So
this is something you find yourself needing to do, uh, that would be really
helpful for you to take a look at this package. Uh, you should definitely check
that one out. Thanks, Yannick, for writing that up.
Yeah.
Larapath is a secure, fluent path builder for PHP, featuring senet- sanitization
strategies and Laravel integrations for version 11 and above. The package's use
case range from multi-tenant storage organization with privacy protection, file
naming conflict resolution, and data loss prevention, among others. So this allows
you to, using a base folder, so for example, pathbuilder::basestorage, you can
add, uh, values using the add method. So for example, if you wanted to provide a
path for a user at email.com, you can say that you want to use a sanitization
strategy of hashed and then convert that to a string. And this will give you the
path location storage/ and then the hashed value of the email address. It also
allows you to create URL-friendly names by using slugification or converting to
snake case, and allows you to create, uh, timestape- timestamp-based values
for uniqueness. The package also includes a Laravel integration with a facade. Uh,
it also includes validation and security, which automatically validates dangerous
paths, as well as the possibility of manually checking a path. Main features
include it being a security first package, built-in protection against directory
traversal attacks. There is a fluent API providing clean, readable path building
with method chaining. Sanitization strategies include hashing, slug, snake
case, timestamp, as discussed. It is immutable in its operation, which provides
thread-safe path building with no side effects. It uses the strategy pattern,
meaning it has an extensible sanitization system that you can contribute to
yourself. There is full type hits and IDE auto-completion, and a Laravel
integration, of course, using the optional Laravel storage facade integration. You
can get started with this package. We have links to GitHub and the documentation in
-the show notes. -Very cool. Yeah, we actually had to do
something like this ourselves, where we had to build this, um, sort of path
builder out on a per tenant basis. So this is really interesting. Uh, I'll be, uh,
I'll be digging in on this one to kind of figure out what pieces what maybe- might
be able to pull out of this, or if this is something we can sort of replace our own
implementation with wholesale. This looks really, really well done, so
super cool. Uh, all right, let's talk about Smartcache. So, if you've ever had
to cache large payloads, this might be something that you would want to look at.
So the Smartcache package, uh, written by Ismail Azaran, is a caching optimization
package which is designed to enhance how your application handles data caching. So
it can intelligently manage large datasets by applying optimization techniques like
compression and chunking and more. So think about if you had a large amount of
data that you needed to cache. What this will do is it'll take that large data, it
will attempt to optimize it, and then it will, after-... attempting to optimize it.
It'll check the data size automatically, and if it needs to, what it can then do is
it can take that data and chunk it into multiple pieces and store it in the cache
in multiple pieces, and then it'll also store that metadata alongside of it. And
then when you go to retrieve it, it'll look at that and say, "Do I need to
retrieve multiple chunks? Yes, I do." Go ahead and grab all those, decompress it,
and then present it to you on the front side. Um, so it basically just does all of
that in the background for you. It has driver-aware optimization strategies, so
if you have to be using Redis or File or databoy- database, it will handle
different chunking and optimization techniques based on that driver. So you
can look into the README to see kind of what's going on behind the scenes, but
exactly what I described is what's happening, checking data size, compressing
or chunking it, storing that optimization, uh, metadata for retrieval,
and then reconstructing that on the, uh, way out. So the API is very similar, uh,
to Laravel's cache facade. The only thing is that you use the facade smart-cache
instead of cache.put, get, same things that you're used to using with cache. So
definitely check this one out if that's something you're run into before.
Yeah.
The Laravel zxcvbn package is a validation rule that estimates password
strength using a PHP port of Dropbox's
zxcvbn JavaScript package. It considers using user inputs as well to determine a
score for password guessability. You can define a zxcvbn_minscore configuration
value in your environment value to determine when validation should fail and
based on the scale provided by the underlying package. Uh, the default is
three, but depending on your needs, you can configure it to match any of the
following. I'm not gonna read through all of the values zero through four, but zero
means the password is extremely guessable. It is a dictionary word like password or
mother, and they will score a zero value. Uh, all the way up to four, being very
unguessable with the estimated number of guesses in the order of 10 to the power of
10, and provides strong protection from offline slow hash scenarios. It is
important to remember that Laravel has excellent password rules out of the box,
including the ability to ensure a password was not present in a previous data leak.
You can see the documentation for more details, and we'll have links to this
package in the show notes for you as well.
Awesome. Let's talk about spies. So spies many times is considered, uh, something
that you would, uh, think about in context of a testing environment, and this is not
what we're talking about here. What we're talking about is an HTTP spy. So the
Laravel Spy package is a lightweight package that will allow you to track and
then log any outgoing HTTP requests in your application. So you can launch this
with zero config, uh, so you can just install it, and it'll immediately start
logging these requests. Uh, they could be really useful for debugging and monitoring
any external API calls that are made from within your own application. But if you
are a discerning developer, you might be thinking of a couple of things that that
could cause problems with immediately, such as sensitive fields, right? If you're
sending a request out and you have sensitive fields that are a part of that
request, wouldn't you want to obfuscate those? And the answer is, of course you
would. So that is where you do the configuration. So you can configure which
URLs are included that you're interested in logging. Maybe you don't want to log
every outgoing request. You only want to log certain URLs that are going to be put
into the log, and you can do that. You can also ensure that sensitive fields are
obfuscated by saying, "Here is the list of fields I would like- make- like to make
sure are not included in the logging." Or if they are included, they're gonna be
obfuscated so they're not usable by, um, you know, dangerous folks that might be
looking at your database. The package uses a global middleware to accomplish this,
and you can ensure that the requests are cleaned up in production by using the
included spy clean artisan command. And, of course, Paul Redman, everyone's
favorite human, is going to make sure, uh, that he recommends that you configure
this package to remove those sensitive fields, uh, before you use this in your
application. Really cool stuff there. Thanks, Paul, for writing that one up.
Notable is a Laravel package that adds polymorphic note functionality to any
eloquent model. It allows you to attach notes and comments to models with creator
tracking, timestamps, and powerful query scopes. The package is helpful for any
note-taking features you might need on a model or for tools like auditing logs and
user feedback. It includes powerful query scopes, and you can easily add note
support to a model using the hasNotables trait, which will give you the ability to
call the addNote method when a customer adds a note. You can support agent
responses in the context of a ticketing system or a support system. Uh, you can
get notes with creator to get the conversation history. You get- can get
notes from today, from this week, this month in a given range of s- of dates, and
you can search notes for a particular message. Uh, polymorphic relationships
allow you to attach notes to any eloquent model. Tracking of who created each note
is also polymorphic. Automatic created at and updated timestamps are added for
tracking of notes. There are powerful query methods for filtering notes. It is
configurable, so you can customize table names through configuration. There is an
easy integration using simple trace bait... trait-based... trace bait?
-Trade-based- -Trace-based
... implementation, and it is ready for all of your Laravel applications from
version 10 and above. We'll have links to that for you in the show notes.
Very cool.
This is, uh, interesting one. This package, I feel like I wished it existed
way back in the day, um, and it may have, because it's actually using Bootstrap
5 behind the scenes. Um, so if you still happen to be using Bootstrap, then this is
great. Uh, if not, you might want to wait a little bit before using this one,
because tails- Tailwind CSS support is coming soon. What exactly am I talking
about?What we're talking about here is Formelo. So Formelo is a level package
that is designed to automate the generation of forms. Instead of creating
these forms manually with HTML, you can leverage eloquent models to define the
structure of those forms. So you can think about, "Hey, here are the attributes that
I have available to me for a eloquent model." All that information can then be
used to say, "I am going to create an HTML form specifically for that eloquent
model." Of course, that saves time, but also ensures consistency across your
applications. So, according to the developer, Formelo was created for
developers who need to generate forms quickly without the overhead of a complete
admin panel but who also want a simpler, more intuitive API than complex form
libraries. So the key features are that it has easy form definitions using Laravel
classes. So if you can write an array, you can write a form definition. Uh, it will
automatically render the form for you. It has support for various field types, such
as dates, text fields, text inputs, text areas. Uh, it's got customizable widgets
as well as mel- uh, as well as automatic error handling, and displaying and form
validation integration, as I mentioned before. Bootstrap 5 by default, but
Tailwind CSS is coming soon. So, the mini version of the tutorial here is that if we
have an article, for example, you could create an article form that extends
Formelo, and what you're gonna have there is a create method, you're going to have
an edit method, and then you're gonna have a fields method. So, create, uh, and edit
are going to define what type of verb it's gonna be, post or patch, uh, the
action, the route where it's going to send that stuff, and then the fields, of
course, is just what you would think. Here is the name of the field, here is the
value it's gonna be coming through as, and then here is the label that you're going
to have. If it's a select, of course, you're gonna have something like choices,
um, et cetera. So if you already have a model, you can use an artisan command to
generate this field for you automatically. You just artisan make formelo, and then
pass along the model, model=article. It will go ahead and do its very best to
guess which fields you're going to need there. It's gonna generate that form for
you, and then you can use that by rendering the form inside your blade.
What's that look like? Inside of your controller action, you're going to new up
that form class that was just created for you. You're gonna pass that through to
your front end blade. Uh, there is a little bit of work you're gonna have to do
to set up. Uh, they're going to say, "Include Bootstrap 5 assets," make sure
you do that. But also, you're gonna have to include the formelo styles and scripts
using two directives that are included inside of the package. And then all you do
is you $form
render. So that's it. Uh, really, really simple there, and then it's gonna go ahead
and generate the HTML that would be necessary in order for you to see those
form values on the front end there. Um, so looks pretty interesting. I- I've not
seen what the form looks like on a front end. I don't know how customizable that
is, um,
but if you're just looking for something sort of quick and, like, "Hey, we need
just something that, that works," and- and whatever, and it's maybe internal use,
I'm not exactly sure, may- maybe this works great for you. Uh, again, it doesn't
have a whole lot to say about the customizability of the forms that it's
creating. Um, maybe it does, maybe it doesn't. I'm not sure. But, um, in any
case, seems like an interesting project. So, check that one up. Thanks, Yannick,
for writing that one up.
Yeah. Looking, looking at the, the GitHub, the README for it says that it is a
comprehensive form generation and handling tool for Laravel applications that is
inspired by Django Forms.
Um, so it has built-in support for Bootstrap 5 and support for Ta- Tailwind
CSS is coming soon. So, at the moment, it looks like, uh, Bootstrap Form, so maybe
if you need it for your Laravel applications that are using Tailwind at
the moment, hold off for the time being. But it does give you the ability to, uh,
publish assets and things like that, so it's entirely possible that you can
re-styler these things yourself. But, uh, keep an eye out on that, because, you
know, we love a form builder. Makes life nice and easy.
-Sure does. -Okay. Tutorial time. We have four
tutorials. We have, uh, five framework reminders this week, and we spoke last
week about the video series on, um,
better... What- what- how did we, how did we term it? Let's have a look at the show
notes last, last time. We was talking about, um... Oh, I just put a link to
Twitter, which doesn't help. Um... Advanced Eloquent Mastery is the series
that, um, Harris was building, and he has released now the first episode of that. So
let us go through, uh, first off, the tutorials. Uh, first cab off the rank,
adding autocomplete to your Laravel application. So if you've ever had to
implement a search feature that has become hugely important for most applications
these days, uh, make sure that you are valuing user experience so that users can
search what they need to see without scrolling endlessly. In this tutorial,
written by Abdulrazak, uh, Jamiu-Ideye,
we will build a movie application that leverages MongoDB's Atlas Search with
Laravel to build a rich text, uh, rich text-based search feature that allows
users to search for movies by typing a few letters.
Do you wanna take the rest or do you want me to just fly through them all?
No, I'll- I'll go for the next one too. Yeah.
-Perfect. -I'll- I'll get the next one.
-Okay. -No problem. Um...And the next one we're
looking at is the implementation of user confirmation dialogs in Laravel Livewire
with the wire confirm property. So, uh, if you've ever had to do this before, you
know, sometimes you reach for the default confirmation dialog that you get with
JavaScript, which is very simple and works really well, but it's not super
stylistically matching to maybe the rest of your UI, right? It just feels a little
bit clunky sometimes. It's a native a- uh, you know, native JavaScript API, and so,
eh, it, it's okay. But Livewire provides developers with an intuitive approach to
implementing these confirmation dialogs with this wire confirm directive. So, uh,
this feature addresses that common need for preventing accidental execution of the
critical operations, like deleting things, uh, while also maintaining your
code to be clean and declarative. So this, uh, tutorial is gonna go through how you
can use that wire confirm directive seamlessly so that your code continues to
stay clean and you get all the benefits of those confirmation dialogs. I will say
that, uh, Flux has also been a godsend. We've been using, uh, Livewire Flux, and
it has really been absolutely gorgeous and really nice to work with. So if you're
looking, um... You know, this tutorial is excellent, for sure, but if you're looking
for something that looks beautiful, functions really well, and is just, uh,
really a pleasure to use straight outta the box, you should definitely check out
Flux. A lot of hard work and effort has been put into that by Caleb and the team
there, uh, at Livewire, so definitely check that one out, as well as this
tutorial. Thanks, Harris Refotopoulos, for writing this one up.
Yeah. Uh, what have I got here next? Optimizing Laravel Livewire performance
with computed properties. Uh, so this is something that, that was, I think, in
like, Livewire version two, it was a bit problematic, where it would always have to
compute. If you were returning collections and things like that, it would
have to keep doing these things all the time. Now Livewire provides you with a
computed attribute that you can attach to your methods, and they will expose these
things in such a way that they're not recalculated every time your component is
re-rendered in the browser. So, uh, definitely check that out if you have ever
run into, you know, the mysterious performance issues of your Livewire
components before.
Okay, last tutorial before we get into the framework reminders. This is by Samuel
Stancil, really, really smart dude. And the title of this one is Using SQLite in
Production with Laravel. So, SQLite is the actual default, I believe, now for
Laravel. When you spin up a new application, it uses SQLite by default,
and it is a really good database for many, if not most Laravel applications
when it's well configured. And that's sort of the trick, right? We're gonna get to
that, uh, but it can provide great performance even if your app has a lot of
concurrent requests. But why would you use it over MySQL? When is SQLite going to be
the best for you? Uh, what are the main benefits of SQLite? Um, et cetera, et
cetera, and on you go. So, what do you need to be aware of when you're wanting to
use this in production? Do you need to use something like Turso, which is like,
hosted SQLite? So, if you've been interested in using SQLite in production
and you want to know sort of the gotchas or the things that you need to be aware of
before deploying this as your production database, you should definitely give a
look through this tutorial. It's gonna talk about the different modes, uh, for
SQLite that allow you to unlock really good potential performance, um, as well as
like, rollback mode, data types that you can use inside of SQLite, um,
transactions. By default, transactions don't acquire locks until you need them,
for example, so how do you make sure that that's all set to go? Um, and, and just a
couple other pieces that you would want, uh, if you were deploying this. So, recap.
Using wall mode, mindful of data types, uh, use this override, uh, that he
includes here only until PHP 8.5, but something you need to be aware of in any
case. So, definitely check that one out if SQLite is something you've played around
with and you'd like to deploy that to your production application. Uh, a couple
things you're definitely gonna want to be aware of in that case. Thanks, Samuel, for
writing that one up. And we've only got framework reminders left, my friend, so
I'm gonna let you roll through there, and then we've got a video to cap off the end
here. Um, and I'll let you take that one, too.
Perfect. So, our five framework reminders this week. First up, enhanced queue job
control with Laravel's throttlesExceptionsFailWhen method. We
have streamlining application automation with Laravel's task sched- scheduler,
Laravel's enhanced string validation with inverse methods,
building cross-platform alerts with Laravel's notification framework, and
preserving data integrity with Laravel's soft deletes for recovery and compliance.
This is your homework for this week. It's always good to keep an eye out for
Harris's, um, framework reminders where, you know, we will talk about things at a
very high level, we will say, "This new feature has been introduced in this new
release of the framework." Harris goes and spends a lot of time going through these
kinds of things and fleshing them out, providing more content, providing, uh,
visual aids, providing code examples and usage examples, and things like that, that
we just don't have the capacity or the ability to do on the podcast without
dragging each episode out to longer than it needs to be. So, definitely check those
out. Keep your eyes peeled. It was great to catch up with and meet, uh, Harris
face-to-face in Denver, uh, about a month ago now. So, uh, definitely check him out.
He's a great guy and does some wonderful work. And speaking of Harris, as I said,
he's started his, uh, new series. I believe it's been renamed now to Laravel
in Practice. The first video, nine minutes in length give or take, talks about
you, uh, how you can stop writing a bad controller. So, we've all written a
controller, the one that's got, you know, 15 lines of business calculations that
you've copied to three different places. In this latest, or this first video, he
shows how Laravel's custom collection methods can transform these messy
controllers into clean, reusable code
that actually makes sense. This is a series that he's publishing on
our YouTube channel. We have links to that for you in the show notes so you can, uh,
like, subscribe, hit the bell, do all the things, uh, and keep your eyes out for
that series.
Excellent. Folks, that wraps us up, episode 244. Thanks so much for hanging
out with us. You can find show notes for this episode at podcast.laravel-news/244.
If you liked the show, we would really appreciate it if you'd rate it up in your
podcatcher of choice. Five stars would be absolutely incredible. And of course, if
you have any questions or comments, we'd love to hear from you on Twitter, on X, on
Bluesky, all of the places, @MichaelDerenda, @JacobBennett, or
@LaravelNews. All right, folks. Two weeks now, two weeks later, two weeks from now.
We'll see you then. See ya.
Bye.