YouTubevideo· Mar 12, 2024· 24:47

Laravel 11 is Here (and I'm so excited)

Watch on YouTube ↗

transcript

56 moments
  1. there's two big releases in the Lille ecosystem today Lille 11 and Reverb so why don't we take a [Applause] look now I've been waiting for this particular release for a little bit since it was first publicly announced or teased mostly because I think a lot of the changes that are being made and introduced into larl 11 really benefit people like me people who grew up in the

  2. JavaScript ecosystem and are looking for something a little bit more batteries included and one of the things that's been on my mind is that sometimes you create a new lay application and you're like hey there's so many files there's so many things I need to figure out and what does everything do but this is a way to simplify things to streamline things to make things a lot better for the end user who's just getting started

  3. with Lille and for those who have been in Lille for a little bit and still give some of those benefits as well but I think one of the things that that Taylor out well described as is just Simplicity that's the goal today so today we're thrilled to announce the release of laravel 11 and laravel Reverb now laravel Reverb is something I haven't got the chance to play with just yet but I do know what it does it's basically a websocket a first party website

  4. websocket package instead of before it was usually Pusher or a I think is another one but now Laro Reverb is first party out of the game so let's take a look as we announced the LaRon EU lar LEL 11 introduces a minimal application structure using sqlite by default implementing Health routing offering per second rate limiting supporting graceful encryption key rotation improving Q

  5. testing introducing new artisen commands adding resend mail transport I have not heard of that one integrating prompt validator and more check out our founder and CEO Taylor otwell live demonstrating what's new in larl 11 if you haven't gotten the chance to watch this video go and take a look it's really interesting it's awesome to see just the purpose and the reasoning behind moving everything

  6. into this new Direction Reverb is the latest addition to the laral ecosystem and is a first-party scalable websocket server that has been introduced to provide robust real-time capabilities to your applications to get all the juicy details about this release check out our official release notes and upgrade died below cover some of the highlights so let's take a look at these this is what I'm this is what I'm here for I'm basically just want to take a look at

  7. these with you and see what my thoughts are on it as well it's just something to think about as you're either just getting started with laravel or upgrading so minimal application structure this is the part that really excites me because I think that it's one of the biggest turnoff for a lot of people who live in the JavaScript ecosystem or just people who like a

  8. little bit of minimalism in their code or they want a batteries included framework but they don't necessarily want everything given to them all at once want to add the things that they need at a given time and I think that's this is what lar 11 is offering so larl 11 introduces a minimal application structure for new laral applications without requiring any changes to existing applications the new

  9. application structure is intended to provide a leaner more modern experience while retaining many of the concepts that laral developers are already familiar with the app folder has been massively simplified both the HTTP and console Kernels have been removed the nine middlewares that were rarely customized have now been moved into the framework itself the exception Handler has been removed and the provider's directory has been streamlined to a single provider here's what the new app folder

  10. looks like now this is really interesting because I I've been I'm one that I think is created for there's a lot of people who do customize every single you know HTTP and console kernels the middlewares all that stuff most of the time I haven't touched any of those for my applications and if I do I'm adding something and adding like a custom middleware and we'll get into or maybe it gets into exactly how to do that but it's really simple it's basically you just add it to I believe

  11. you add to the app service provider they have a way to do that now where you don't have to add your own custom middleware and then add it to the web middleware group that kind of kind of thing so here's what the new app folder looks like rest assured customization remains priority to adjust the highlevel application here we go it's at app.php to adjust the highlevel application Behavior settings you can utilize the revitalized bootstrap app.php file this

  12. file allows you to modify your applications routing middleware service providers exception handling and more correction it was not the app service provider it's this revitalized app.php so now there's a lot of great things I like about this one I like when everything is as in in one place as possible and this kind of provides that capability so instead of having to have middlewares in three different spots and

  13. then you're when you're when you're in your service provider you are implementing some things on boot or on load this just simplifies that so now you have your routing your middleware surface Fighters your exception handling all of that in one file some of the things that is stands out to me when I'm looking at this is you have your with middleware uh function right here but then you have being able to have exceptions as well as a pending so that's the biggest thing is you can say

  14. a pend or prepend so depending on where you want a new middleware in your middleware life cycle maybe you want at the beginning maybe you want at the end of all of the standard middleware that comes out of the box and then it's and then exceptions as well so yeah I like this I think it's clean I think it simplifies a lot of things that people can get caught up on when you first if you're brand new you type in Lille

  15. new your application name most of the time you're I don't know you can feel a little bit overwhelmed I think this helps alleviate those that stress in addition the routes folder has been simplified API and channels are no longer presented by default since many applications do not require these files this is cool that's what I I I've used API I have not used channels because I haven't used any kind of real-time thing

  16. and it's interesting to see that Reverb is launched with this which I assume would use the channels. PHP route but most of the time you just need your console and web I think it's going to talk a little bit about the new way of using console commands as well which I'm excited about okay instead they can be created using simple Artisan commands this is great as well instead of having to make all these yourself they're saying hey here's some

  17. Artisan commands PHP Artisan install API and now you have those files as if they were already generated so you don't have to worry about okay let me create this file copy and paste something from the docs these application commands these artisen commands are already given to you you just have to decide when you need them and there's more there are numerous details about lille's new application structure that we can't cover in this blog post make sure to check out our release notes I'll probably be diving a little bit more into lar of 11 and the specifics about

  18. Lar 11 I'm going to be doing like a primer with larl 11 and Livewire next week so larl Reverb brings blazing fast and scalable real-time websocket communication directly to your Lille application and provides seamless integration with laravel's existing Suite of event broadcasting tools such as laravel Echo furthermore Reverb supports horizontal scaling via Redd's

  19. published subscribe capabilities allowing you to redistribute your websocket traffic across multiple backend Reverb servers all supporting a single high demand application so this is one thing that I was actually listening to the Lille podcast with Taylor Atwell and Matt ster and it's something that really interested me one that one they mentioned in the Pacos that they're running forge on the 4 gigabyte server

  20. and then two within Reverb you don't have to be limited to the server that your application is running on you can split Reverb across um multiple backend servers and you can support high demand application doing that you don't have to limit it to one server that Reverb is running on it is not currently capable to run Reverb on laravel vapor at this

  21. moment but it's not that hard to set up a new server to run re Reverb to support your level Vapor application which is what I would probably do for any application that I need Reverb so here's an example of a stress test with 30,000 clients maintaining open connections to reverb so you and your your three users I think you'll be fine 30,000 clients maintaining open

  22. connections through re where each connection is subscribed to 10 different channels and more than 6,000 messages are being exchanged per second so you know Reverb is obviously for people who just are doing like fun projects additionally that's just crazy it's it's crazy to me that laravel developers the Lille team is

  23. providing something like this that's that works great with laravel that is built specifically for larl out of the box without you having to you know pay any extra it's free and it is something that they just want to give back to the community in this way it's something that you can build a full product a full company on this software it's crazy Additionally you may monitor the

  24. performance of your Reverb servers in larel PSE to get a better understanding of the number of connections and messages being handled to dig deeper into Reverb consult the complete Reverb documentation I haven't uh talked about laral pulse in a video I did a live stream talking about laral PS and playing around with it but it's awesome it's using the tall stack so it's using Live Wire and it's keep benefit is just being able to monitor some of those like expensive queries expensive long running

  25. queries that kind of thing without having to without having to set up a whole another monitoring system lar pulse just gives you all that out of the box and you can do custom cards in larel pulse as well sqlite by default this one is probably one of the more controversial ones but I want to tell talk about how it's not what you probably think it is if you were saying hey this Lille is now SQL Ed by default you would probably be think thinking okay so it sets up SQL light for me but

  26. then what happens if I want to if I know I'm using you know my SQL or postr or something like that that's not what it is by default new Lille applications use sqlite for databased storage as well as the database driver for Lille session Q cache and Q furthermore creating a project using composer create project command or through the leville installers that's what I use if I'm if you're using larel herd or valet or anything like that you have

  27. access to larel new than your application name it will automatically create the sqlite file and run the initial database migrations for you so one of the things it doesn't necessarily mention here but what it means by sqlite by default is that is the one that is defaulted so if you just press enter as you're creating a new layer application it's going to bring up sqlite first and you can just Arrow key up Arrow key down to the database that

  28. you need because it's using LL prompts that's the command line interface to give you the option of what database would you like by default it's equal light and that's usually the one that I automatically set up every single time I'm creating a new Layel application so it's awesome that they give you this because one I think sqlite and a lot of creators and a lot of developers have

  29. put out amazing content on sqlite but sqlite is completely capable for a production application especially if you're not necessarily sure if this is going to be something that scal or if you want to put any more time and attention into that put it on a server with sqlite and you're good to go it's awesome I'm still waiting for the turo laravel sqlite integration I don't think that it's possible right now I've been

  30. following a couple couple poll requests to see where where where it's going I think it's a lib SQL issue with PHP but that will be really interesting or we can get turo with larl because I think then you could use sqlite with turo uh and larel Vapor for example okay this allows you to begin building your application immediately after creating a new lay application

  31. without being required to install additional software or create additional database migrations again I think all this kind of is uh narrowing down to the fact that the laral team wants to make it as easy as possible for new developers and for people who are just creating a new lville project to get up and running as fast as possible so when you create a new lville project lville new your application name you get the

  32. opportunity to just be ready with cash with database drivers with cues and not have to install reddis or a different database for example Health routing this is really cool just it's super simple you there's there was a bunch of different packages like spotsy even have their own package to give you this but now it's just there for you new Lille 11 applications

  33. include a health routing directive which instructs larel to Define a simple health check endpoint that may be invoked by thirdparty application Health monitoring services or orchestration systems like kubernetes by default this route is served at slup we saw this in in this app.php file here so you have this health command with in this with routing directive so you have your routes your commands and this slash up so you can modify that just right there it's a one

  34. line so when HTTP requests are made to this route Lille dis will dispatch a diagnosing Health event allowing you to perform additional health checks relevant to your application such as verifying database connectivity ensuring the cash is working as expected that's really interesting I did not know that I knew they did a a brief overarching Health test but this is really interesting so if you needed to say hey

  35. I want to make sure that my connection to open AI is still valid you can just run it in this dispat diagnosing Health event and then that slash up just handles all that for you I love it Q interaction testing previously attempting to test that a q job was released deleted or manually filled was cumbersome and required the definition of custom Q fakes and stubs however in

  36. there 11 you may easily test for these Q interactions using the with fake Q interactions method okay this is in pest so it may release a job with a delay and pest I think is Now the default but of course you can still use PHP un name job is with fake interactions handle assert released love it besides the assert released assertion which you can use to verify if a job was released back into the queue you may also use the assert failed or assert deleted

  37. assertions to determine if a job has been failed or been deleted respectively this is awesome cuz it's one of the trickier Parts I had to deal with and I ended up just not not doing tests for that particular aspect of my application but I was using open AI with my application secure Quest and it's a lot of background jobs it's a lot of cues it's a lot of checking to make sure that okay open AI actually returns some information and I can move on with the

  38. next job or batch of jobs and it was tough to test that and this would have been great and I'll probably actually Implement that in the next couple of day next couple of weeks graceful encryption key rotation since larl encrypts all cookies including her application session cookie essentially every request to a laral application relies on encryption for security reasons however because of this rotating your application's encryption key would log out all users of your

  39. application in addition decrypting data that was encrypted by the previous encryption key becomes impossible so this is one of the things that L Taylor was actually talking about on the lville podcast was if you wanted to change your application key for whatever reason let's say you're just change it frequently to for security purposes or you had some sort of issue that you need to change it now all of your users let's

  40. say you change that when you let's say you're changing it when you push a new push a new pull request into your application well in the past all users would have to be logged out and then logged back again because there's no way of decrypting that data and then re-encrypting it for the new application key even if those are valid users but now larvo 11 allows you to Define your application's previous encryption Keys

  41. as a command or a comma Del comma delimited list via the app previous Keys environment variable that's super interesting so when encrypting values laral will always use the current encryption key which is within the app key environment variable able when decrypting values larl will first try the current key if decryption fails using the current key then larl will try

  42. all previous keys until one of the keys is able to decrypt the value this approach to graceful decryption allows users to keep using your application uninterrupted even if your encryption key is rotated for more information on encryption and larel check out the encryption documentation this is really interesting I don't know enough about this world to know okay what's the purposes of rotating your encryption key so often but to be able to do that

  43. without having to hurt your current users is something that I could see being extremely valuable especially in maybe more security minded applications banking that kind of thing so the fact that you can now do that without having to change the user experience for your users is awesome and so much more these are some of the things that uh we can't cover in

  44. this particular post per second rate limiting that's awesome so instead of having to do I think one minute was like the lowest for rate limiting so per second resend mail transport I want to take a look at that one prompt validator integration new Artisan commands model castle one of those new Artisan commands is those like install commands model cast improvements the once function got to take a look at that

  45. one improve performance when testing with and memory databases improve support for Maria DB and more so we encourage you to check out the release notes and upgrade guide for more information with the new improvements and improvements in laravel 11 new features and improvements finally we would like to thank the larl community for their contributions to this release we are truly grateful for the time and effort that so many of you have dedicated to making laravel 11 a reality we hope you enjoy the new release and

  46. look forward to seeing the amazing applications you build with laravel 11 awesome I love it one of the things that I it's probably in the and more one of the things I thought was really interesting was if you chose pest or PHP unit as your testing Suite anytime you create a new test using an artisan command it's automatically using your PHP unit or your pest setup so you don't have to change that one of the things

  47. I'll probably actually put in a a PO request for is doing the same with volt so I love volt class API and I always forget always forget any time I'm creating a new volt component I always forget the dash class and so it'd be awesome if I you know already set up class API with Breeze if I create a new volt component and just use this class automatically I know there's probably some ways that you would want to mix and

  48. match but I haven't seen anybody do that within an application yet so we'll see let's take a look at so one first things level Reverb I actually saw of a video by Luke Downing I'll probably push put that over over in this little section in a little bit uh when when I'm editing this but one of the things that it's cool to be able to get a demo of larel verb up and running very quickly I think he did it

  49. in a couple minutes without having used Reverb at all before but again first party websocket server that you if you're using lville Forge for example they just have a oneclick toggle and it just installs Reverb for you um this demo is is awesome so this is like real time so someone is on this site right now clicking that clicking

  50. those emojis so you're subscribing via Pusher here's the oth here's the channel and the messag is handled so all a sudden you have your Reverb server and that's what it does it's blazing fast steamless integration with their broadcasting capabilities you can monitor with baked support with Lev valve pulse it's built for scale Pusher protocol so it utilizes The Pusher protocol for web sockets making it

  51. immediately compatible with leville broadcasting and larel Echo I love it available now so I'll probably make another video on testing that out and maybe building a cool little application but that's awesome okay so the recent mail transport is being able to use recent so if you haven't heard of recent to be able to have an easier way to send it mail to send email to your

  52. users without having to use like sces or postmark for example Lille now has or recent now has a recent lville package and then within the mail driver you just put the transport as resent and now all of the mail that you're using within like a mail facade is using the recent API instead of having to use anything else with lville that's awesome I think also have a yeah right here they also

  53. have a resend facade to be able to if you want to like within a controller or within a volt component for example send a send an email quickly through resend I've actually done this with one of my applications where I didn't necessarily want to create a whole I I wanted a quick email being sent I didn't want to have to use I didn't want to have to create a new mailable so I just used the HTML function and just passed in HTML to

  54. that to that method so that's awesome overall I'm really excited for the Lille application announcement for the Lille application release and for things like Reverb and some of just those little things that have come with laravel 11 mostly because I'm excited for the new wave of laravel developers this is going to introduce into the ecosystem people who are turned off of all of the files all the configuration that's just given to you if you need it because most of

  55. the time you don't necessarily need it and I think that's what the creators and the Lille team have come around to is like most of the time you don't need those config files most of the time you don't need those middlewares or any of the service providers most of the time you just want to get up and running as quickly as possible using a SQL like database for development and just build something get something running and if that's the magic that you need then L 11 is going to be a perfect fit for you

  56. because you don't have to worry about all those other things that kind of are given out of the box until you actually do need them and then it's just as as simple as using a CLI command to generate the things that you need overall super excited to play around with it I'll see you next time

just you here