October in February, new terminals, and modularized Laravel

Download MP3

Jake (00:01)
Hello world, hello, hello, hello. Welcome to Laravel News, episode 209. It is February 27th or February 28th if you're in the upside down. It is also a leap year this year, so happy leap year. We've got an extra day in February, so we will have a February 29th this year. And if you happen to be one of the few people in the world who was born on February 29th, congratulations on your birthday that only occurs once every four years. We're so excited for you. Message us on Twitter, let us know.

We'll mention your name on the podcast next time or something. A little shout out for those people who had birthdays on the 29th. I wonder how does that work? Do they just celebrate their birthday on the 28th probably? I'd guess.

Michael (00:39)
guess so. Yeah. The 28th or the 1st of March, I suppose. Take your pick, whichever, whichever you want. Um, obviously you're still aging here. You're just not, not technically celebrating it.

Jake (00:41)
Or the first, right? March 1st. Yeah. Yep. Mm hmm. Mm hmm. Mm hmm.

Sure. I had to try to explain leap years to my kids the other day. And they didn't get it. I think eventually they sort of got it, but they were still like, why don't we just make it, they were like, why don't they just make the days in the year like 366 days a year? Like, well, you can't do that. Cause then you'd be ahead three quarters of a year every year. And they were like, or three quarters of a day, or you're like, oh, what? I don't understand. Anyway, we've also been talking about us. Go ahead.

Michael (00:55)
Mm -hmm.

Do you know what? No, no regular person is standing out there and like putting a notch somewhere to say, this is where the sun is. This is where the sun is. And making sure that it's in the same place, like 365 days later. I don't think it, it matters that much. Let's just, let's just add an extra day somewhere.

Jake (01:23)
Yeah.

No, well, it wouldn't matter for us, but it would matter in. Well, so here's what here's when it would matter, right? In how long would it take? How long would it take if you lost it? So if every four years it was a day off within like multiply by 30, where there'd be 120 years and 120 years, you'd be off by a month. Right. And then in what, seven hundred and. 20 years.

Michael (01:33)
every month.

Just make every month have 30 days.

Jake (01:56)
something like that, you'd be off by six months. So like you'd be half a year off. So like in a...

Michael (01:58)
Yeah.

Yeah, but we've already replaced the calendar once. Let's just get rid of, let's get rid of the Gregorian calendar with the, we don't need a leap day, leap year calendar. Like who cares about where the sun is? The sun, you know what thing is the sun never moves. The sun is always in the same place. So it doesn't matter. Let's just have every month with 30 days and 300 and whatever that is days in a year. And we'll call it, we'll call it even.

Jake (02:09)
Oh, I like the leap day. Come on.

That's true. That's true. Yeah. Yeah.

So, you know, that's an interesting idea. I mean, I think we could probably figure it out. We could probably figure it out. Yeah. But if we could make it more standard, but it's okay. We've figured it out now. We've got the whole thing now. Dude, I mean, I was thinking about, or not thinking about, but listening to a podcast about timekeeping and how important it is to be able to like actually keep time and how we just take it for granted that we have these little machines that can help us keep perfect time on our wrists.

Michael (02:31)
360.

Mm -hmm.

Mm -hmm.

Jake (02:54)
And they were talking about how it wasn't until they could keep time that they could figure out positioning on the sea because they could measure like how long it had been since they left shore. And then looked at like, they knew when perfect noon was supposed to be from where they left. And then they could measure how far the sun was off of dead center in the sky. And then that's how they could determine their longitude based on like where they were. So interesting. Just all these things we just don't even think about anymore. You know, it's just like, it's done for us.

Michael (03:09)
Mm -hmm. Mm -hmm.

Mm -hmm.

But, but we don't, we don't need to do any of that. We're not, we're not like frontierists sailing the seven seas with like no technology on wooden boats getting, getting scurvy. Like we don't need any of this stuff anymore. Get rid of it all. You, I mean, Americans don't even have the metric system. Don't tell me, I suppose that's why you need all of this nonsense.

Jake (03:27)
I know. I know.

Ah.

Well, you need it for like GPS. You got to know. It's true. Yeah, it's true. It's probably true. I know. I know. I was thinking about that. Okay. Okay. Shall we? Let's do it. Well, you know what? The first thing we have here is actually Laravel 10 .44. And we were talking about this just a minute before we started the show. And we have actually covered this in slight less detail in a previous episode, but we're going to talk about it again today.

Michael (03:48)
All right, let's move on before we get ourselves in trouble.

Jake (04:08)
And also, really glad to have our fearless leader, Mr. Eric Barnes, covering this first topic, at least, in a YouTube video. So Eric's been doing a great job putting out all this wonderful content on YouTube.

Michael (04:21)
Can I just say, I thought you were going to segue. I thought you were going to do the segue into the sponsor that we've got here for the first time this show.

Jake (04:28)
Mmmmm

Michael (04:31)
Take away. Error tracking, error tracking and bug reporting and alerts and all of that good stuff. We are very excited to have for the first episode sponsorship from Sentry. Sentry is a long time member of the Laravel community and they have returned to us. They've, they've sponsored before, but they are back.

Jake (04:56)
Indeed.

Michael (04:57)
They'll be with us for the whole rest of the year, so we'll talk a little bit more about them a little bit later.

Jake (05:02)
Indeed, indeed. I do want to mention one quick thing about Sentry real quick, which is at Lericon 2023 when we were in Nashville, was really excited to be able to chat with those folks. They have some really cool new tools that they've released that I cannot wait to try. One of them being Cron Monitoring. So they have a brand new Cron Monitoring solution that they've released not too long ago.

It looks incredible and it will actually replace a couple of the tools that I have in my stack that I've either had to develop myself or use a service for. I'm already paying for Sentry, so I'm going to start using Cron Monitoring through them, which I'm really excited about. And then the other thing that they have is they actually have a session recording. So previously, I was using a service called Hotjar for this, and so I'm going to be switching over to Sentry for this as well. I was just talking to some of our leadership today at work about using this on one of our applications. So...

Michael (05:27)
Mm -hmm.

Mm -hmm.

Jake (05:54)
Really excited for all the new offerings. It's not just error tracking, it's all sorts of other good stuff. So thankful to have them back as a sponsor so we can talk about them all we want. Thank you, Sentry.

Michael (06:01)
Yeah. We'll have loads of things to say about them over the year.

Jake (06:07)
Indeed indeed. Okay, so with that being said Laravel 10 .44 back to that again Laravel News has had It's a YouTube channel blessed with Eric Barnes recording all these awesome screencasts And I think we've seen the subscribership tick up in the past couple months just based on all the new content He's been putting out so great job on Eric on that. So let's talk about 10 .44 Laravel News really sorry the Laravel team released 10 .44

this week, that would have been the week of February 16th, with two eloquent model attributes to define global scopes and observers and a new select collection method as well as a couple other items. So let's talk about this scoped by and observed by attributes. Now, when we're talking about attributes, we're talking about this little thing that you can put above a method or above a class where it's like, and I'll give you the syntax here, it's like pound sign, square bracket, name of the attribute,

arguments that go with the attribute and then closing paren closing bracket, right? So this is what I'm talking about when I'm talking about an attribute. If you haven't used them before, might not be something that's super obvious to you. That's what we're talking about specifically. So these attributes, I believe were introduced in 8 .2. Is it 8 .2? Maybe? PHP 8 .2?

Michael (07:24)
or further back now i think eight hp8 they were introduced i reckon yeah i think so

Jake (07:27)
Is it? Were they really? Have they really been around that long? Oh, my word. Maybe they were. All right. You can look that up while I keep talking about it. So, Eliezer Magaraten contributed a scope to by attribute, which allows you to register global scopes on your eloquent models. So if you have a global scope that you want, let's say something like a tenant scope where a tenant is logging into your application and you want to place a scope across.

all different queries that might be hitting your user table and say I'm only interested in those users that belong to this particular tenant. So you put a global scope on that user class. Well, typically what you had to do previously was say inside of the protected static booted method, you'd have to say something like static add global scope and then pass in the scope that you'd be doing there. But now what you can do is instead of all of that,

You can just add this scoped by attribute. And then you can pass either a single class, a single scope class, or you can pass an array of different classes. You could say, I want to have a global scope of tenant. I also want to have a global scope of some other thing. And you could just pass it either as an array there, or if you only have one, you just pass the single item in. So that's really cool. So single observer or an array observers. And you can also define multiple attributes for your model. So you could say,

scoped by a single value, scoped by an array of values, or you can say scoped by single, scoped by a single, scoped by, you can have multiple attributes that all say the same things. That's possible as well. Same contributor then also contributed an observed by attribute. And this will register model observers on your eloquent models. Once again, instead of having to inside of the booted method, put those observers, now you can just say observed by and then pass in in the same way, either one item, multiple items in an array,

Michael (09:02)
Mm -hmm.

Jake (09:19)
or you can repeat yourself observed by, observed by, observed by multiple times. So this is really great. And also, it feels much more discoverable. Some of these things can be sort of problematic in the case that somebody doesn't know where to look to know that these things are happening. But now they're just declared right at the top of your class, which I think is the best part of it. It feels really nice, really clean, very Laravel -ish. And you can...

Michael (09:37)
Right. Yeah.

Jake (09:46)
I'm interested in your feedback on this, but doesn't it seem like maybe a couple years ago, sort of the feeling towards these attributes was like, I don't know, I'm not really sure about this, but it feels like there's been a shift to really saying, let's adopt these, this feels pretty good now. And I think enough people have used them now that it doesn't feel super foreign when you see them.

Michael (09:58)
Mm -hmm.

Yeah. Yeah. They use quite extensively throughout the LiveWire code base. I think Daniel Coborn, when he introduced verbs, there's a lot of attributes and he talks a lot about attributes as well. Um, but yeah, as you say, this is a much more discoverable way of doing it. Typically with observers in the past, I've put them all into a service provider that is like observers service provider, just so that I have one place to go and look at all of the places that are using.

Jake (10:13)
Yeah. Yep.

Mm -hmm.

Michael (10:37)
Um, you know, model observers, which I think is a bit more discoverable than putting them into the models, boot method itself, because then you still have to know which models have got observers registered to them. But I think flipping this now, it means you don't have to have a service provider around just to do this one thing. And it means that you can see in the context of that model, all of the things that are happening to it, both, you know, the scoping, the scoping, I don't really use as much in terms of like scope classes. I'll have scope methods.

Jake (10:49)
Mm -hmm.

Michael (11:07)
but not typically scope, scope classes. But I think the observed by attribute, I've already upgraded our version of Laravel and implemented this across our code base to make it. Um, you know, this is, this is what we're doing in the future now. So yeah, I like this change and I'm not one, you know, I'm very late coming to the attribute party. So happy, happy to be here. Thanks for having me.

Jake (11:28)
Yep, indeed. And also, I love that you can just click through on these as well. So you have the class name defined right there. You can just click right through it and go to the definitions. That's really nice. OK, moving on. Craig Moore has contributed a new collection select method that selects a certain number of keys from a multi -dimensional array. The select method is similar to a SQL select statement. So you have a collection with a multi -dimensional array that has some keys and then some values.

Michael (11:33)
Mm -hmm.

Jake (11:55)
And then what you could do on that is you can just select out a list of, it's almost like pluck, I suppose, right? Where you sort of are plucking out these different keys. But now you can just use select, which feels more natural if you're coming from or sort of treating it like almost like a query, right? And so now select feels pretty good and you just pass an array of values and it will grab those out, keeping the keys intact and discarding the rest of the values.

Michael (12:16)
Mm -hmm.

Jake (12:23)
that were in there. So that's pretty nice. Mark Townsend contributed a toBase64 and fromBase64 for the string and stringable classes. These methods wrap the base64 encode and base64 decode methods respectively. So you can just call those on the stringable methods, which is a nice little addition there. There is a new array take method introduced by Ryan Chandler. This will take a certain number of items.

from an array. So it takes them from the front of the array with positive numbers and then takes them from the end of the array if you're giving a negative number. So you have a collection of nine items, let's say. If you say, take three, it'll take the first three. If you take negative three, it'll grab the last three. And on you go with that. That is it for 10 .44. You can find the diff between 10 .43 and 10 .44 on GitHub, of course, and release notes in the change log as well.

Michael (13:20)
Amazing. Something that we don't hear a lot about, I think lately in the Laravel community is October CMS, which has been around for a number of years now and they have released version 3 .6 full of new features, including a new multi -site sync mode, new form designs, phosphor icons, nested relations in plugins, autocomplete for blueprints and flash progress messages. So we won't talk too much about.

Jake (13:30)
Mm -hmm. Long time.

Michael (13:49)
what all of these things are in detail. It's nice to know that we still have options in the content management system space out there. As I said, October has been around for a long, long time. It's approaching its 10 year anniversary. And the team has been working diligently over the past seasons to get the release ready. This was originally planned to be version four, but since Laravel 11 has made some changes to its bootstrapper, they decided to delay a major release to incorporate the new...

Laravel improvements. So they worked very hard to make all of these new features backwards compatible. And you can enjoy the benefits sooner than if you had waited for the new version of October. As I said, there's a lot of stuff to get through here. So I will put a link to the show notes, which covers all of this stuff off. But as I said, code completions, multi trait improvements, new hinted URLs for plugins. There's an API docs refresh, new form designs, including a basic, a sidebar.

a survey and a pop -up design. There's flash progress messages. There's nested relation support. There's a video that explains that and some of the future horizons. As I said, this was originally slated to be version four, but they've had to rejig their roadmap a little bit to account for the fact that they've made all of these changes backwards compatible in the current version, in the current 3 .x version. So thanks to Samuel Georges.

who is a developer on the October CMS team for putting together this article.

Jake (15:17)
Yeah, this was definitely one of the early ones. I think they released this. I mean, if it's been around for almost 10 years, pretty close to the introduction of Laravel, right? Maybe a year in or something like that. So yeah, they have been around for a long time and excited to see them still around. Not too many projects that are, you know what mean? There's a lot of code bases that were built on early versions of Laravel that have just not survived the...

the gauntlet of the open source. And so October team, congratulations on another version out. The other thing that I noted on this that I haven't heard of before is this Phosphor project. Have you seen this before? These icons? Yeah. Have you seen these before? I use Heroicons for everything, which is great. They're designed by Steve Shoger. They're incredible. They do a really good job. And they've got these new micro icons as well, which are good for really small UIs. But...

Michael (15:58)
The icon set. No, no. I haven't.

Mm -hmm.

Jake (16:14)
Sometimes it doesn't have the icon I need, right? Like there's some there are just occasions where the limited icon set does not have what I need. And so Phosphor actually has a ton of icons and they look really good. And I believe they're SVG as well, just like the Heroicon ones are. So it's not like some weird font syntax thing, you know, it's just, you know, modern SVGs look really, really nice. So I'm going to be giving this a try.

Michael (16:38)
Mm -hmm.

Jake (16:42)
Told my team I messaged them actually just a little bit ago and was like hey, we should check these icons out So anyway, there it is Okay on to the news my friends PHP storm. How many of you out there using PHP storm? Raise your hand. Yep. Yep. Me too. Me too VS code users out there anybody hands no Vim Michael raise the hand. Yeah sublime some people What's that now? You got DHH on Vim?

Michael (17:03)
Oh yeah, we got DHH now by the way.

We got DHH using, using, using Vim now. We'll see how that goes.

Jake (17:10)
You know what? You and me need to stick on after this call because I need to talk about Vim bindings in PHP Storm. I have some questions. There was some like visual select stuff. I was like, why can't I figure this out? Why is this not working? So anyway, I'm wanting to use, yeah, I know it's not a perfect situation, but I want to use the Vim bindings. And I know some people who do that as well. So.

Michael (17:20)
Okay.

I think, I think the long and short of it for the context of this podcast is that the Vim plugins that are around are not the same as Vim. And so there's always going to be bits and pieces missing. And so that they just, for whatever reason, don't, don't work as you'd expect them outside of Vim.

Jake (17:43)
Mm -hmm. Mm -hmm.

Yeah, and that's okay. Like, for the most part, I'd... Right.

Yeah, yeah. And for me, like that trade -off is worth it. But anyway, it's that's not what we're here to talk about. We're here to talk about PHPStorm getting a brand new terminal. So again, Eric Barnes has a great video on this one. But coming to PHPStorm 2024 .1 is a new redeveloped terminal. Now, I have some developers on my team that choose to use a different terminal. Like I use Iterm. That's fine. Like I use Iterm2 whenever I need to.

Michael (17:57)
Mm -hmm.

the

Jake (18:20)
SSH into a server or when I need to do something like on my computer not related to a project. However, if I'm in a project and I'm using PHP Storm to do my editing, I don't ever get into a terminal outside of PHP Storm. It seems silly to do so. You just press command one and you're in your terminal. Like there it is. You're seeded to the correct directory. It's just right there. So don't know why people do that other terminals. But if you've not used the terminal in PHP Storm before, you definitely should. And now you definitely, definitely should.

Michael (18:36)
Mm -hmm.

Jake (18:49)
because it's a new redeveloped terminal that includes everything from visual changes to each run command, but inputting its own block. So you run a command and then it has a dedicated block that represents that command and all the output that went along with it. And then you can navigate between those in history, right? You can jump between those blocks, which is kind of cool. There are also easy keyboard navigation between those blocks.

There's command completion features that support commands, paths, arguments, and options. So, you know, think like Z shell, auto completions sort of deal. And then a newly signed command history. So there is a demo video, like I said, JetBrains also has their own announcement about it. So I think the way that you can get this is in the announcement as I was looking at it. I think if you go into the terminal in PHP Storm and then in the top right hand corner,

there is a little triple dots icon. You can just say enable new terminal and you will have the new terminal. So I have not tried it. I'm going to try it though. So it supports Z shell bash and power shell. If you use any other shell, you'll see the old terminal even if the new setting is enabled. So just FYI. Okay.

Michael (19:59)
Interesting.

Hmm. It looks, um, it looks a little bit like warp. I don't know if you're at warp .dev, which kind of, you know, chunks up all of your commands and, and gives you all of that replayability, auto completion stuff. So interesting. I wonder, I wonder what it's based on, if there's any commonality between the two there. But I'm, I'm all for more people having access to the terminal and using the terminal wall sounds like a very smart thing to do.

Jake (20:08)
Mm -hmm. Yeah.

Yeah, I don't know.

For sure. Yep. Indeed. Agreed.

Michael (20:30)
Okay. Larricon EU, which was just last week, the week before. It's been in the last couple of weeks at the time of this recording. The videos for most of the talks from the conference are now online in a YouTube playlist that you can watch. Talks from the event include JetSarch's Laravel polls behind the scenes, surviving large applications from Bobby Bowman, managing 5 ,000 plus tests efficiently from Kristoff Rumpol.

Jake (20:53)
Just watcha.

Michael (21:00)
Real time Laravel from Joe Dixon and of course, Taylor's customary Laravel update. So all of that's, that's just a handful of them. There is, what are we going to say? 20 or so videos there from this year's LaraCon EU. Definitely check them out. There's, I've heard rave things about the, um, Kristoff's talk. I've heard wonderful things about Jess's talk, Tim's talk, Luke's talk.

There was one other that I wanted to talk about, but all of the talks at all of these Larikon events and the Larival Live events are typically wonderful. So check them out. There'll be links to them in the show notes. And also if you want to attend an in -person event, the next one coming up is at Larikon India. You can check out all the upcoming events on the Larival News events page at larival -news .com forward slash events. We have links to that for you in the show notes.

Jake (21:59)
Indeed, indeed. Okay, let's talk about some packages, shall we? So have you ever wanted to have application settings inside of your application? Well, Laravel Setting Pro is a package that provides a really simple and effective way to handle your application settings. And there are a couple of different drivers for it as well. There's persistent storage using either file -based storage or database drivers. So...

How do you use the package? Well, you can use this setting function, which is a global helper, essentially, where you say setting, and then inside of the first argument, you give the name of that setting, and then you can say get, and then specify the key. So you could think of it almost like you do with config. So if you have config, the name of my config, and then you have a key inside of that config that you're looking for.

Typically you sort of do it with like dot notation, right? You'd say like for example, you do config services dot stripe dot API key or something like that this feels a little bit similar in that you have like a setting like Namespace if you will so setting my settings get key and then you provide a default value as well So there's a couple different syntaxes you can use kind of depending on if you prefer to be more explicit

Or if you prefer to just kind of name all the arguments in a single go, you can do it either way. So that's how you get one is just by calling that get. You can set a value by doing a similar thing, just calling set instead of get. And then you can also delete a key from a setting calling arrow delete. So again, namespace, key, and then value or default value, set or get or delete. There you go. OK.

Also, you can use a setting facade. So instead of using a global helper, you can also do setting, dodo, and then similar. Select the namespace, the key, provide a default value, et cetera. So both of those ways work. You can either use that global function or you can use the facade. Now, what are the features that includes? Well, again, there are multiple drivers. You can choose between file -based or database storage. There are multiple database drivers like MySQL or Mongo.

It will cache these settings for you either by file or redis. You can choose your own cache driver. It has queue support, so it'll update these settings in the background for you. It has event triggers, which allow your application to respond to different changes in those settings using these real -time Laravel events. Again, there's a global helper function or a facade that you can use to modify these. There's artisan commands that you can use to install these different settings or to publish them.

And there is also, as we mentioned earlier, setting and deleting with dot notation. So it feels a little bit more similar to the config. So there you go. It looks like it's a pretty interesting item. Again, what I think of it is, is like config, but persistent config on a per user basis or a per team basis or whatever you might have that you can modify inside of your application. Because that's not something you typically want to do inside of config, you know, because...

It's not going to persist between requests or whatever. So there you have it. The pro, sorry, application settings with setting pro. Thank you, Eric, for writing that one up.

Michael (25:19)
Mm -hmm.

Awesome. LaraCord is a micro framework to build your next Discord bot with Laravel alongside Discord PHP. With this package, you can create commands, for example, bang commands, slash commands, events, and more. Your bot can respond to these features using familiar artisan console tools and everything we love about Laravel.

The main features out of the box is support for databases caching and many other Laravel features. Thanks to Laravel Zero, we've got the ability to instantly generate working bot commands and event listeners with zero knowledge, generating asynchronous services and tasks and optional HTTP server with native Laravel routing and live by support, fully configurable and extendable functionality alongside a beautiful console logging with timestamps and it is fully documented and contained.

To get started with the package, check out the documentation at laracord .com. The source code is available on GitHub. We have links to all of that for you in the show notes.

Jake (26:24)
Well, my friends, it is, uh, we told you, we talked about a little bit earlier and it is time. So we're going to talk about Sentry. So Sentry is error tracking for your Laravel application. And I will say as a long time user of Sentry, which I have been using it for at least, I think six or seven years, uh, I have never failed to be impressed by the error handling and the stack traces that Sentry gives you. Anytime you get an alert that there's been an error in your application.

You always see a great breakdown of exactly what the error was and clicking into it, it gives you all the context you need to pinpoint that error exactly where it lives in your code base and go solve that problem. There's a couple other features that I really, really like, which is you could provide additional event context for any requests. So one of my favorite things is when you can assign a user to that context. So sometimes what I'll do is before I even know what the error was, I can quickly reach out to that user through a Teams chat application or something like that and say, Hey, noticed you had an error.

I want to let you know I'm working on it. Is there anything I should know about what you were working on, what you were doing when that occurred? In addition, they also have great performance monitoring as well. You can also see successful session metrics. So you can see how many sessions lived without any sort of error. They have, as we mentioned before, incredible CRON monitoring in your application. And then the last piece, which is also really cool, is you can create releases.

when you push code out to production. And when you do so, it will take a diff of your code, as well as all the commits that went in, and it will look at the author that committed that particular line of code. So when there is an error on a particular line, it can auto assign or give you an idea of who should be looking at that code in order to solve the problem, because it knows who most recently changed that line. So all in all, it's an incredible error tracking tool. Really love it and would suggest that you use it.

anytime you need error tracking. We do have a promo code, which is Laravel News. If you go in and type in that promo code, I think you can get some sort of percentage off. Michael, what is it? There's some percentage off, isn't there? There is, I know there is. Hold on, here it is. He says, Laravel News. Yep, yep, two free months of Sentry if you use the Laravel News code. That's all one word, Laravel News. Thanks again, Sentry, for sponsoring the show.

Michael (28:31)
question.

two, three months.

Tempo is the easiest way to work with dates in JavaScript. It is a new date package designed to be small and the easiest way to work with dates in JavaScript.

In a proud tradition of JavaScript date and time libraries inspired by the likes of moment JS, date JS and date functions, Tempo is built from the ground up to be as small and easy to use as possible, including first class support for time zones. Tempo comes with a variety of format styles, including full and tokens for formatting dates in any way that you might need. You can also find a large number of modifiers and as I said, time zone support.

Jake (29:13)
Ooh, that's actually pretty handy right there.

Michael (29:27)
It's impressive. It's offering much of what you might need to work with dates and has excellent documentation around functionality that you can start with at tempo .formkit .com. We have links to all of that for you in the show notes and who doesn't want another date library.

Jake (29:44)
JavaScript Date Library, indeed. Carbon for the win. We've got another one here, Laravel Wallet. Now, I feel like we had one just not too long ago that I think was something like, oh boy, what was it? There was something where you could essentially, yeah, it's like you could see, you could add and subtract and handle like, it wasn't currency, but it was almost like play money, I think was the idea.

Michael (29:58)
You have walked yourself into trouble.

Jake (30:10)
This one is designed for reliable and flexible transactions. And the reason why there are so many of these is because there is a really complicated problem to solve, right? Similar to like how there's a hundred date libraries we were just talking about, right? Laravel Wallet is another one of these that helps to handle the complex part of storing transactions in the database for precise calculations. Good thing about it is the API is really intuitive and easy to use, very straightforward. And once you follow the setup instructions, all you have to do is put a has balance trait.

Michael (30:10)
Mm -hmm.

Jake (30:39)
on any model that you want to be able to use this with. So some possible commands that you could work with is transfer an amount and a, so like you could say transfer 100 and then you can specify the currency types like USD or, you know, whatever, US dollars or whatever other ones there might be. And then you could say from, and then pass in a user object and to another user object. And then you can commit that transaction. Another thing that's interesting about this is you can roll back.

transactions, rollback mechanisms in order to revert these different modifications. It also has safeguards for balance accuracy as well. So really cool stuff. Thanks Paul Rudden for writing that one up. L 'Hervéle wallet.

Michael (31:23)
Internachi Modular is a package to give you a modular system for Laravel applications for features that you want to build modulily. The package provides convenience methods and tools that aid you in creating modules within your application. And once you install the package in your application, creating a module is as easy as running an artisan command. It has features that make breaking up your code into modules easy, yet still keeping Laravel conventions like creating new Laravel modules via the artisan command, auto -loading via Composer,

A Laravel provider and alias discovery via composer, customizable configuration conventions around modules, commands that are auto -generated with artisan. A migrator will automatically run migrations that are spread across your modules. Model policies are auto -discovered blade components, event listeners are auto -discovered and a whole lot more. Chris Morell has a walkthrough video of this. Mateus has a...

course on Laracast that was released in the last month or so at the time of this recording that goes through building a modular Laravel application. And he spoke on the same topic at Laracon EU in the links that we will have for the Laracon EU videos that we spoke about earlier in the show. So definitely check out all of those resources. I think there are certainly certain situations where having a modular approach in your application, where you kind of co -locate everything into like

mini app folders, rather than having all of your controllers together and all of your models together and all of your events together, you would start splitting these things out into, I guess, you know, modules or the domain specific areas of replication. And you would then replicate that entire application structure within each module. And so this package modular allows you to kind of simplify the process of scaffolding that all out and running it and making sure everything is discovered in a way that you would expect in LR of our application. So we have links to all of that for you.

Jake (32:46)
Mm -hmm.

Yeah.

Michael (33:15)
in the show notes.

Jake (33:16)
Yeah, we actually did this. We had one application we called Micro, and we found that we just had a bunch of different small things that we needed to do that required maybe only like two or three models, right? And instead of spinning up a whole new application, a whole new URL, DNS records, all that stuff, for every single time we wanted to create one of these new micro applications, we said, nah, forget it. We're just going to create what we called it was like an umbrella app.

Michael (33:30)
Mm -hmm.

Jake (33:41)
an umbrella Laravel app. So when we needed to go from Laravel 10 to 11, we only had one app to update rather than 13. So this package certainly does a much better job than what our application did in breaking these things up into modules. So I'll definitely be giving that one a look. Hey, if you ever wanted to use Google's Gemini AI API in your Laravel application, there is now a Gemini PHP package for that. So it's built around the Gemini PHP client. And so it provides a facade to interact with the API and AI models that are currently

Available it can work with text images and video video simultaneously with the Gemini provision model and It gives a couple examples here in the code of what it might be able to do So for example, you can put a picture you say what is this picture and it'll go through and describe that picture for you This picture shows a table with the tablecloth on the table of two cups, etc. Etc. Etc So if you want to use the Gemini AI stuff, you should definitely check this one out. Certainly gonna make that process much easier

Michael (34:42)
The last package that we have here is if you have ever needed a simple Kanban style board with swim lanes in your Laravel project, and you are using the filament framework, you can easily add Kanban boards with the filament Kanban package by Mo Gosh. We actually do. Last year we spent a bit of time putting together a Kanban style application. Unfortunately, we're, we're

Not unfortunately, we're using Vue on our front end. So we couldn't use, make use of this one with filament and live wire, but this allows you to create Kanban board in seconds using the plugins provided artisan command and easily customize the board in several ways.

It allows you to integrate a Kanban board with an eloquent model, customizable modal appearance, customizable views, configurable edit modal form schema, customizable records query, drag and drop behavior, dark mode support and more. The plugin author Mo has two demo applications available to see the plugin in action, which we'll have links to along with all of the documentation, the package and further instructions in the show notes.

Jake (35:45)
Okay, I'm going handle these last two real quick here. These are tutorials and both of the tutorials that we have are basically talking about essential plugins for your particular IDE or code editor. So the first one is on PHP Storm. The second one is on VS Code, which are the two probably most popular editors in this space. Let's talk about the PHP Storm ones real quick. There is a Nord theme, Laravel idea, which is 490 a month, but is very much worth it. It's incredible auto completion for routes, eloquent model support, et cetera, et cetera down the list. It's really, really good.

There's also a package for ENV file support, which allows you to click through, see all your ENV variables directly inside of your code, which is really nice there. There is a thing called editor config, which allows you to share a dot editor config file between any of your multiple computers that you might have or multiple developers that you might have on the team. So that's pretty great. There's a collector plugin called

collector. It adds supports for layer of collections and also will suggest refactorings like if you have an array map, it'll automatically convert it to a collection and then use the map function on the collection instead. There's also Codium, which is a free AI code completion at chat tool. So if you've used GitHub Copilot before, this is like the free version of that available for a number of editors, including PHP Storm, but also has a VS code flavor as well.

There's also IntelliView, which is an IntelliJ plugin that gives you utilities for view single file components. That's all of those for PHP Storm. Thank you, Paul Redmond for that one. Real quickly on the VS Code side, we have Laravel Blade Formatter, which does exactly as it's printed on the tin, as Michael would say. There is also Kodium, same one we just talked about, AI, autocomplete, and chat. We have Amanakai.

Pro theme, which is really great. This is the same. This is the theme that I use. I really, really like it. PHP IntelliFence gives you intelligence, code intelligence for PHP in Visual Studio Code. You're going to definitely want to use this if you're a newcomer to PHP. Better PHP Unit, which supports running tests from your editor in the embedded terminal. And then Tailwind CSS IntelliSense, which basically goes through and orders your classes for you automatically, provides autocomplete syntax, highlighting, linting, et cetera.

Really, really good stuff. Thanks again, Paul, for writing that one up. Folks, that's a wrap. This is episode 209. Thanks so much for listening. Find show notes at podcast .laravelle -news .com slash 209. Head us up on Twitter at jacobbenn at michaelderitta at Laravel News or watch us on YouTube. We're constantly putting out great content on there. Rate us up in your podcast. Your choice five stars would be incredible. Thank you so much to the entire Laravel News team for putting all this together. Thank you so much for hanging out with us and listening. We'll see you in two weeks. Peace.

Michael (38:25)
And thank you to Sentry. Bye!

Creators and Guests

Michael Dyrynda
Host
Michael Dyrynda
Dad. @laravelphp Artisan. @LaraconAU organiser. Co-host of @northsouthaudio, @laravelnews, @ripplesfm. Opinions are mine.
October in February, new terminals, and modularized Laravel
Broadcast by