Taylor Otwell Keynote

The founder of Laravel, Taylor Otwell, announced framework updates and 3 major releases at Laracon US 2024 in Dallas, TX.

Transcript

00:00:01 [Music] feels good to be back um it's been an awesome first day thank you to all the speakers thank you to all the sponsors for making this event possible um before this talk I was thinking I think this is my 20th official Lon talk if you count LaRon us LaRon EU LaRon Australia and now LaRon India um I've given quite a few talks and honestly I still love working on laravel every single day um I feel just like super lucky that I get to work on this amazing tool with this amazing community and I'm not burning

00:00:53 out on working on laravel I'm still uh honestly as excited as ever to keep working on everything we've built together so before I keep going actually I was backstage and I could not see raise your hands again if this was your first LaRon wow so okay that is crazy like the majority of the crowd it's your first LaRon awesome 2024 it has been a very busy year for us at laravel um in fact it's probably marked the biggest shift in the company's history at the very beginning beginning this year laravel as a company

00:01:32 was me and like nine other people um now we are a team of over 30 full-time employees um so it has been a rapid change and honestly it has been really awesome we have built an awesome team um throughout the beginning of this year and it's been a privilege to work with all of them but why did we do this uh why did we hire so many new people you may have seen our new lal.com careers page the reason is because we've been tackling some of the most ambitious and exciting projects that we've ever worked

00:02:08 on as a company and that I've ever been involved in um and we had to grow the team to make that happen so where was laravel 10 years ago when I first launched laravel Forge which was a huge turning point in the company's history just like this year has been um larl Forge was the tool that allowed me to go full-time working on laravel so that was a huge shift in the future of laravel and the future as future of us as a company well as you can see back in 2014 laravel was getting just 6,000 composer installs per day not

00:02:48 bad right um and then just five years ago in 2019 when we launched laravel Vapor laravel was getting 60,000 composer installs per day so where are we today um August 2024 we are now getting a qu million composer installs per day on average for the laral framework pretty mind-blowing um and laravel's been around a while right we're kind of dating ourselves by even giving these figures you know all the way back to 2014 which is an eternity in Tech web development time uh so many things happen you know new backend Frameworks

00:03:33 have come out hundreds of new front-end Frameworks have come out and laravel is still around and why is laravel still relevant today and I believe it's because laravel is the most productive and enjoyable way to build full stack web applications without going crazy to be honest um and I think that's what makes laravel so special it includes auth communication authorization file system abstraction queuing payment processor integration and a wide variety of first-party packages that all work really well

00:04:12 together are really well documented and just flesh out a really cohesive ecosystem and what I also like about laravel is that not only does it bring this enjoyable productivity to the back end it also brings that same productivity to the front end we have awesome front options when we're building laravel apps tools like laravel Livewire which let you build modern reactive Dynamic web applications using just PHP and maybe with a little bit of Alpine JS sprinkled on top we have inertia JS we actually don't hate

00:04:47 JavaScript uh in the PHP world I know that's surprising to some we have inertia which lets you write a modern laravel backend and then gracefully pair that with a front end written in reactor View using typescript and so you can take advantage of all of the vast robust libraries available in those ecosystems as well so where do we go from here at one of the very first lcons over 10 years ago I said that our Focus as a company was developer happiness at every step along the application development

00:05:23 life cycle from local deployment all the way to shipping to production and that's really what I'm still FOC focused on today is improving that entire experience earlier this year we launched laravel herd for our Windows users we launched the Mac version last year at laracon us and I think this was a huge leap forward in how people develop PHP applications locally you have one menu bar application you can download and you have PHP composer even my SQL in a self-contained application so that when

00:05:57 a new developer gets a laptop they just have one thing to download and they're ready to build awesome laravel applications in a couple weeks we'll be shipping our Forge integration for laravel herd so this lets you actually link your Forge account to laravel herd see your sites and your sites on your local machine and what they correspond to on Forge SSH into those sites edit the environment variables and more and this will be coming to her in the next couple weeks we're also going to keep working

00:06:28 on the local development story and it doesn't get much more local than your editor um many of us that have been doing professional PHP development for a while enjoy robust to robust tools like PHP storm and the awesome laravel id idea integration which gives you powerful intelligence for your entire laravel project but what about developers developers that are just coming into the ecosystem um maybe they just want to try laravel out and they've never used professional PHP tooling one of the most

00:07:00 popular free editors for that segment of De developers is vs code and today I'm happy to announce that we'll be launching our official VSS code extension later this fall and I think that right now when you download vs code to build an awesome laravel experience you have to also install five or six other extensions and try to piece together your local development environment with our new laravel vs code extension you'll have one official extension to have an awesome developer experience on VSS code and honestly the

00:07:40 best way to see what it looks like is just to show you today so I'd like to welcome laravel team member Joe tanon bomb to the stage to give you a quick demo of our vs code [Music] integration what's good coming straight out the hood I'm just trying to put the spirit in your I got to do every day Sunday morning what's up everybody how we doing all right okay let's Get Off full screen and back on for okay cool uh show hands how many people use vs code here hey that's what's up okay cool how many people use

00:08:28 uh PHP storm great uh I know we don't have any neovim users here because they would have told us already so um all right we are super excited about this vs code extension uh the goal was to reveal as much intelligence about your project as possible and that manifests itself in four different ways uh autocomplete clickable hover and Diagnostics right so if we could autocomplete a value we did if we could make a value clickable straight to its source we made it that way if we could reveal relevant information about that

00:09:07 value on Hover we put it there at a glance and if we knew that you typed an invalid value into your editor we wanted to warn you right in line so let's take a look okay we have the chirper codebase from the LEL boot camp here in the editor let's load up the web file and so here you can see the config helper uh and as I start typing I get autocomplete value which is pretty cool so we're going to get the postmark token awesome and as soon as that's in there it turns into a link okay so let's click in and see what

00:09:38 happens there let's click into that link great it didn't just go to the file it went to where it's defined in the file so we're trying to get you where you're going as quickly as possible now you can see we're clearly missing some EnV files and EnV variables because uh we have some squiggles here so we have squiggles here we have squiggles here but these ones they're links and you can click right into them and they will go right to where it's defined in the EnV so if you need to edit that value you can click in and

00:10:07 edit it right away uh okay so we're missing some values let's actually fill those values in if you hover over it'll say oh I do not have hover on this mirroring that's a fun thing let's try this again big bummer okay well okay well don't worry about hover that's not happen uh let's make sure that's not a full screen thing not hovering that's awesome okay cool well what would happen is if you hover over it and that value is missing you get a quick fix and it'll just say add it to your EnV and you can

00:10:47 click in it'll add it to your EnV bring you to that EnV file and let you type in the value right away uh furthermore if we have detected that a value is in your EnV example we will offer to just copy that value right into your EnV file so that is uh that makes things a little bit quicker um let me see if I hover here this is just straight up not not hovering great hey no problem uh this also works with your vendor files which is cool so if we have the spoty larel health package installed uh you can

00:11:18 actually get right in here sorry you have to you have to spell Health correctly that's part of it uh and uh it'll link directly to that file and uh on top of which the hover if it was oh hey we got a cover that's great okay yo okay wait hold on hold on let's see if let's see if this now works yeah there we go okay hold on let's back up hover Quick Fix EnV great we just added it to the EnV hey okay so if we fill that value in now it's immediately a link you see the value right there on Hover and

00:12:03 furthermore if we go back to postmark uh you will actually see that value on Hover as well as well as where that config value uh config file is stored uh just to show you to go back one more uh this is a value that we have in our EnV example and what I was talking about is add value from EnV example and immediately it just adds it to your EnV file which is pretty cool so that's config uh this is uh the app binding story so we have autocomplete for all app binding strings so as soon as you uh press press the quote you get

00:12:39 autocomplete uh and it'll click directly into the source where that is actually bound so you can go right to the code when you need to see it uh we also have hover for this so it'll show you this is uh Bound in the cache service provider and you can it'll show you exactly where that file is um which is pretty pretty red um guess what autocomplete for routes we got them uh so if we have the password reset route it becomes a link you get hover it'll show you the the controller and the method and when you

00:13:09 click into it it'll bring you directly to that controller and Method right away okay not to get too repetitive but we have autocomplete for translations as well so if you're localizing your app uh let's Lo let's talk about off throttle not only do you have autocomplete for that you have autocomplete for parameters so we detect the parameters in the translation string and we'll autocomplete that for you as well uh if you have a lot of translations in your app such as the spoty Lara health uh package um we're

00:13:40 going to show you all of the translations that you have on Hover and you can scroll through them right then and there and if something is wrong or need to fix something you can just click directly to that file it'll bring you directly to that translation to fix it uh next up we have uh views and obviously you get auto complete for views uh so we are also parsing those View files and we will um I'm sorry we're parsing those blade files and you get autocomplete for the values that are in that file the VAR the variables that

00:14:10 you defined which is also fun uh if you click through we go straight to that file and we also have blade syntax highlighting built into this package no more extra package to get Blade syntax highlighting you get it out of the box with the new extension uh all the way by the way this is all granularly configurable so if you decide you actually don't want to say like app binding something you can say I don't want Diagnostics on app binding I don't want hovering I don't want linking you can granularly decide what you want

00:14:38 to opt into and opt out of which is uh we wanted to make this as flexible as possible for you uh furthermore uh anybody use inertia in here we have inertia people all right sweet uh auto complete for inertia views so we get this and if we're able to parse your props we will actually autocomplete your props for you as well uh click in straight to that I you can see the pattern here we're trying to like make this as easy as possible uh if you change this View and you decide that it's home and not

00:15:07 welcome um we will offer to just create that missing inertia view for you and it'll just jump right in with a created file cursor in place um okay the star of the show is eloquent right so we put a lot of work into making sure the eloquent autocomplete story was really robust um in in your wear Clauses you get autocomplete for fields on the model um on top of which if it's a nested wear claw so if you have a closure uh you get autocomplete for the correct model there as well as well as any uh change methods

00:15:40 um as well on uh new model creation we will autocomplete for you but only the fillable properties of that model so we just like Whittle it down to what's fillable uh on relations we will tell you what relations are available on the model and we'll autofill that for you and furthermore uh if you need to subquery a relation we will only offer you the fields on that subquery that are related to the model that you are actually relating so for example chirps has messages but something like you know let's say links only

00:16:14 has Type Joe okay uh like URL label order so it it is intelligent enough to know what what relation you're loading in and scope the fields correctly uh okay let's talk about testing so we have integrated with vs code's test Explorer that's built in so if we open the test Explorer uh you can see here that we have a familiar directory called tests and if we drill down into it uh you can run your test directly from this so you can just press play they'll run right there um you can jump to a test file and

00:16:48 you'll notice that test files now have these little play buttons next to every single test you can also run an entire file by clicking the double play button right there um if you need to jump to a specific test you can and it'll show you failures directly in line so expect false to be to be true uh that's going to be and that's also a syntax error which is a different thing uh we can press play it'll fail right in line and it'll give us the error message right then and there you can also see the full

00:17:18 terminal output of the test uh right here so you can look at exactly what was run in the terminal and uh we can just go ahead and fix that test and rerun it and it turned to greenon so this is just a highlevel overview of this new vs code extension and we are really excited to get this into your hands very very soon thank you so much [Applause] all right thanks Joe uh like Joe said I think you'll all really dig this extension we're going to have this out later this fall so you'll be able to kick the tires and get your hands on it

00:18:11 but I think it's really going to level up the laravel development experience especially for newcomers into the ecosystem so I've had enough slides on my end for a while it's time to do the old dig into some code classic Taylor ottwell LaRon keynote style um so we're just going to jump into some cool new open Source features that we've been working on over the last few months for the framework and I'm just going to give a demo of a few of them to you today so let's Jump Right In I've got a little

00:18:39 test laravel application here with a routes file me make this a little bit bigger for you and uh yeah let's jump into the first feature so you can see here in this route I'm using laravel's storage facade to generate a temporary URL to a file that I actually have on digital ocean spaces which is an S3 compa ible cloud storage system so laravel storage faad is really cool in that it lets you work with the same API across a variety of file storage backends that could be local storage it could be Amazon S3 or

00:19:12 cloudflare R2 or like in this case digital ocean spaces but you get to use the same methods in API across all of those file systems which is super convenient because it means you can change file systems at anytime really and not have to update your code that much so anyway I'm generating a temporary URL um and what that means is this is going to generate a URL to this file but it's only going to be valid for 5 seconds so this is a very common use case um or very common thing to do if you have like a temporary file download

00:19:42 that you want to offer to your customer you don't want other users to be able to access this file so you like time limit how uh long the link is valid uh so super common for like secure file downloads okay so if we hit this route um we get a URL and we click it and we get this wallpaper and you can see like if I refresh the page it's already expired and we can no longer access the file great so that's all working as intended this has been in laravel for quite a while actually but what happens if we actually go back to

00:20:15 our application and let's dig into our environment file and let's change the driver to local for like the local file system and now if I hit the route you'll see I get internal server error this driver does not support creating temporary URLs and this has been a huge bummer in the past because if you're developing locally and your application uses temporary URLs you had to actually go out to like S3 or to cloudflare make a bucket or make a space um add the key to your local development machine and

00:20:47 you're like actually calling out to the cloud to interact with these buckets and that's just kind of a bummer because if you're working locally you just kind of want everything on your local file system it's faster you don't have really these external dependencies it's just a much better way to work so this has always been a big paino until now so we're going to be soon launching the ability to enable private local file serving directly from your larl application so how does it work and thankfully it's really simple you just

00:21:15 go into your config file systems file I go down here to the disk and there's a new serve option um so I'm going to switch that to true and if we open up like the file tree over here on the side and we go into storage you can see there's an app private directory where I have that wallpaper that we just accessed on digital ocean spaces uh so it's basically the same file but just on my local dis so if we hit this route now now we actually get a URL and it's using our local application and this is using

00:21:45 laravel signed URLs with uh expiration timestamp so if I try to hit the route again you can see we get 403 Forbidden so we're bringing really easy temporary URLs to the local file system this is awesome for local development but you could even ship this to production if you have a fairly light load production application and you just want to use local file storage on your production server you can totally use this totally production ready and secure uh so that's local private files uh coming very

00:22:15 [Applause] soon all right let's uh let's keep moving let's jump into another feature uh this is a cool one so we call this container attributes so you can see I've got this route here and we're injecting an action into it maybe it's deploy application um I'm going to pop open that class and maybe we want to inject um a value here that's a string and it maybe it comes from our config files so we might do something like string GitHub token let's say um and we'll dump out the value here now if I hit this route the deploy

00:22:58 route you can see that I get an err that there was an unresolvable dependency on this parameter and that makes sense because laravel doesn't know what string you want to inject into this class you just said you wanted a string and laravel's like okay what string do you want you know I don't know what to give you here um and so previously like if we wanted to pull this from the config file and inject it into this class we would have to do something like this we would have to go to maybe like our app service

00:23:26 provider and we would have to do kind of like this whole song and dance where we say uh when deploy application needs GitHub token give this value from the config files and uh hopefully if this works this should actually give us a value um that we can dump out okay and it does all right so we see my GitHub token which is the value that I have in my config files but it's kind of a pain to have to go to your app serice provider you know just to do something relatively simple like that to pull a value from

00:23:57 your config but with container attributes you don't have to do that anymore you can actually put that information right in the Constructor of your class so let's go back and just get rid of this again we'll comment that out and we'll come back here to our deploy action Constructor and now we can use container attributes and just say config Services GitHub token just like that and we'll import that attribute and now we should just be able to hit this route and we get the token so we can pull it right out of the

00:24:26 config file using the built-in contain container attributes and we have a few other thanks and config is not the only container attribute we've built into the framework we've actually built seven or eight of these attributes for common use cases so another one might be injecting a specific database connection into the class with the DB attribute we can inject a specific connection maybe the sqlite connection I'm going to import that attribute I'm we're going to import database connection and let's just go ahead and

00:25:02 dump that out and see what we get all right we hit this okay we get a SQL light connection great that's what we expect and we can just super easily come in here and tweak this so like we could say my SQL and we get a MySQL connection so this might be useful if you have two separate databases for your app maybe one stores like analytics and metrics about the app and one's your primary database and you have a class where you want to inject your analytical database into the class it's very easy just to do that using

00:25:30 container attributes now instead of having to do contextual binding in your service providers we've done some other cool ones but before I show you this next one let me go ahead and make sure I'm logged into this app okay so I'm going to go to the dashboard I'm logged in great that all looks good um we even have an attribute to inject the currently authenticated user so I can just say current user user we'll import that model we'll import that attribute and let's just dump out the user to array all right so we'll go back to that

00:26:04 deploy route and you can see we get the currently authenticated user injected directly into the class super easy super convenient all right so we've that's three of the built-in attributes we've actually written a few more so we have attributes for injecting different file system dis different log channels basically anything that has a driver and laravel or multiple instances you can use container attributes to inject the right instance that you want and you can even create your own custom attributes

00:26:32 just by implementing a simple interface so you can build all sorts of creative custom container attributes for your app or for your package and ship them out uh to your users all right so that's container attributes let's dig into a uh a new eloquent feature eloquent obviously very popular feature of laravel it's really I think my favorite feature of laravel um but let's look at something U with this route so in this route you can see that I'm pulling users with their blog posts let's say um and let's go ahead and just

00:27:08 hit this and see what we get you can see that I've got two users so there's me and I've got three blog posts right here in this Json structure and then we got Jess Archer a second user and she also has three blog posts so two users three blog posts a piece now so what people will do is you know like they'll retrieve the users and they'll start looping through them like this users as user and then maybe they like Loop into the post for each user and then here's where it gets a little gnarly a lot of people want to

00:27:40 try to do something like this they'll go from the post back to the user so like the parent user that owns the posts and they'll access some data on that user so let's hit the route now okay we get what we would expect we get my email address three times we get Justice three times so you know six total blog posts six total email addresses as we Loop through the post but let's see what database queries are happening so I'm going to uncomment this DB listen okay so now we're seeing the database queries and you can see that

00:28:12 we've got like an in plus1 query problem going on so after each email address you're seeing how it's making a query to the user table every time we spin through the post so for each post it's going back to the user table doing a query pulling the user not good right this is a performance problem at scale so how can we fix this what if we want the parent user to be hydrated on the post um so they all share the same user instance and if I update the user on the post it's synchronized across all the

00:28:41 posts it's pretty tricky people actually write some pretty gnarly code to make this happen right now they'll do something like this they'll say like users each uh set relation or yeah users each function user user posts each set relation uh user user I hope this works this is okay we resolved the N plus1 query problem but we had to write some absolutely atrocious code to make that happen and not only is it like ugly code it actually would create an infinite Loop if you tried to return those users from

00:29:19 the route because the users have the posts which have the users which have the posts you know which have the users so it's just an infinite recursion and app would just hang it would actually wouldn't return anything at all um so we're fixing that we're making that much easier so let's get rid of this gnarly code okay now we're back to our n plus1 problem what if there was a much easier way to solve this problem it kind of feels like there should be this feels like overly complex for such a simple

00:29:46 use case well now you can just come into the user model and say you want these posts to be chaperon [Applause] and that's all you have to do and it will hydrate the correct user onto the post the posts will all be synchronized to their user you don't we actually prevent the infinite recursion now so if you try to return this from the route everything works really well it works how you would expect so much much easier and so you can you can shaper around these models in two ways you can find it right on the relation like I did here

00:30:30 but you can also opt into it at runtime so when I make this post query let's do something like this um when I eager load these posts I could actually like get the query here and say post chaperon so maybe you don't want it to happen every time you load that relation only sometimes you could opt into it at onetime like this so now if we hit this route you know we still see we've eliminated our n plus1 query problem and vice versa like if we Define it on the relation okay so we chaperone there we

00:31:04 can actually opt out so we could say like without chaperon and now we like reintroduced the N plus1 query problem but sometimes you might want to do that if it's a small data set and you want each post to have like a fresh instance of the user so you can choose how you interact with this feature but much much easier to accomplish this use case without hanging your entire app or running out of memory or writing some really atrocious code so that is chaperoned eloquent [Applause] models all right let's dig into the next

00:31:39 feature this next feature is the brainchild of laravel team member Tim McDonald who is down in Australia shout out to Tim um he comes out comes up with some awesome ideas so I'm happy to demo this uh on his behalf but this was this was his brainchild and I really dig it I I hope you do too as well um so we have this route route defer you can see we're calling this method metrics report um Let's Pretend This does some really slow stuff maybe it calls out to an API it it works with some external Services um in

00:32:08 our app just to like simulate that work we're going to sleep for one second and then we'll just return a random currency value just to simulate some sort of slow API that we need to interact with and then we'll log the value out to our logs and return it so let's goe and hit this route you can see it took a while okay it took a little bit over a second um which is to be expected because we slept for a second now if you wanted to make this faster or you wanted to do this in the background because maybe the user we're

00:32:41 not even using this for the user we're not showing it on the screen we just need to do it maybe we need to report some sort of metrics to some external service but really the user doesn't really care about any of that or need to worry about that and it's kind of a bummer because our whole app feels slow for this thing that the user doesn't even see or like care about and previously if we wanted to fix this we'd have to write like a q job we'd have to spin up Q workers we'd have to make sure superviser is keeping the

00:33:07 queued workers running um there's a lot of leg work you know just to do something relatively simple like move this to the background So today we're introducing a new way to push work to the background without setting up any cues without running any persistent processes and it's super simple I'll show you how it works we'll just come to this line and we'll say defer all right let's move this over here let's pull up our logs I'm going to start up this 26 milliseconds and you can see that we deferred the reporting of that

00:33:43 metric to the background and we can just keep hitting this route we have no Q workers running we have no persistent processes consuming Q jobs all we have to do is wrap a piece of code in the defer function and it will be pushed to the background to be executed after the response is already sent to the browser and this works because PHP fpm and modern PHP application servers like Franken PHP let us do work after the response has been sent to the user we don't actually have to run a queue or anything like that to just simply push a

00:34:13 function to the background so this is all you have to do to defer something to the background and everything will just work without any other Q processes now [Applause] what if something goes wrong after we defer a function so maybe we're deferring like the sending of a welcome email to the users that just signed up for our app um what if something goes wrong after that so let me show you what happens um let's just throw a new exception here something wow something went wrong my typing went wrong all right so we've

00:34:51 got this exception here and let's go ahead and hit the route again okay so something wentong we see that over on the right side you can see the exception but we never got the Deferred metric call it was cancelled so if an exception happens after you defer a function the default behavior is will just discard the the Deferred function um I think this is a sensible default Behavior because if you're doing something like queuing a welcome email or deferring a welcome email and something goes wrong you don't want to send the email because

00:35:19 the user may not even be in the system if something went wrong um but sometimes you may want the Deferred function to run even if an exception happens so we can actually just chain on a simple method always and if we chain always onto defer the Deferred function is always executed it does not matter what happens in your application after this function is deferred it's going to run um no matter what so now if we hit the route again we see the error but we also see the Deferred function executed later um

00:35:52 so sometimes you might want that to happen if you're reporting metrics to an external service you may want to report those metrics even if if the request fails or or whatever so the always method lets you make that happen all right and what's really cool about defer is it's not limited to just web requests so you can actually use defer in QED jobs and artisen commands and get the same behavior the same cons consistent Behavior throughout your application stack so if I go out to this prod process podcast job you can see I'm

00:36:23 deferring a call to the metrics method and then I'm logging that we're handling the job all right so let's come out here let's start a q worker and let's do I have a route for this let's dispatch it here we'll just get rid of this process podcast dispatch right I'll import that class all right so now if I hit this okay we see handling job and then we see the Deferred function even though deferred function was registered before we logged handling job job you can see that obviously logged after because it

00:37:00 was deferred and the same behavior with exceptions applies to Q job so if an exception were to happen in this Q job after we deferred the function it would be canceled just like on a web request unless you chain always onto the Deferred function call so you can use defer anywhere without really having to think about where you are are you on the CLI are you on the que are you on the web request you can just always use the fur you have nice consistent behavior and things will just be pushed to the

00:37:26 background with no qword workers necessary so that's deferred functions really awesome for just pushing simple task to the background really lightweight really quick no extra workers needed all right let me adjust my screen a little bit here so defer is really cool on its own but we thought there were some other interesting ways we could use deferred functions in ARL itself um and one of those ways is a new method in the cache but before I show you that let me show you an existing method cash remember so

00:38:06 you can see in this cash route I'm calling cash remember and I'm specifying the key as metrics we're caching them cashing these metrics for 5 seconds we're just going to get three metrics from our service again it's going to sleep for a second each time it pulls a metric and then we're going to return that cash value so we would expect this first page hit to kind of take a while let's to see what happens we hit cach it's spinning you can see this took 3 seconds so pretty slow if we hit the route again it's pretty fast because we

00:38:37 cashed it for 5 seconds but now it's like recalculating again so now we're getting another slow request and then we're fast again um and this is okay it's not super ideal why because a lot of users are going to hit these slow requests so someone's got to be the Unlucky user that hits the app when your cash is expired and they have to sit there for 3 seconds while everything recalculates and that's kind of a bummer um so we're fixing that so we're introducing a new cash method called Cash flexible and when you do cash flexible

00:39:13 you actually pass two values and this is pretty sweet so I'll explain both values so the first value 5 seconds if someone tries to access the cached value before 5 Seconds we just immediately serve the cached value uh you know it's still fresh the data is still good if someone requests it after 10 seconds so after the second value we unfortunately have to recalculate the cach we consider the data is too old um we can't show it to the user because it's just been too long it's totally stale uh so we have to recalculate it

00:39:44 and the user probably will get a slow request but the real magic happens in between the two numbers so let's just go ahead and hit the route and let's just look at the behavior and then we'll talk about what happens between the two all right so we're going to hit the cash drought we're going to get a slow request cuz we got to hydrate the cash okay there it was slow okay now we're fast so let's keep an eye on the time and on the numbers you can see the numbers updated but we were still fast and if I keep

00:40:13 hitting the route we're still really fast let's see if they'll update again they updated again we're still fast so no one's hitting slow request even though the data's got to be recalculating somehow and let's dig into how this works so if a user hits the route in between the two values say they hit it 7 seconds after we cached we actually serve them the cache data because we still consider it pretty good but we defer a function to recalculate the cache in the background using defer so it's basically an implementation of the

00:40:46 stale while revalidate pattern if you've ever heard of that and you don't have to set up any Q workers you don't have to set up any background processes it's just an awesome fast experience for all of your users just by you you using us cash flexible and the power of deferred functions in laravel really [Applause] cool all right I'm super pumped about this feature I think I'm going to use this quite a bit actually um let's keep moving we got this concurrency route this is a slow one um so in this route

00:41:22 we're doing a lot of work you can see we're calling metrics five times it takes a second each time so that's it's going to be at least 5 Seconds we've racked up on the response time and a lot of times you need to do slow work that isn't necessarily necessarily related to each other it needs to happen in any certain order like maybe you need to call a couple different apis or even need to make a couple database queries but it doesn't really matter what order they happen and they don't really need

00:41:47 to care about each other um so usually you end up just doing them synchronously all in like top down order like I have here and if we hit this route we can see this one's going to been for a while come on all right so we finally made it 5 Seconds not good right we can't ship this to users but since all these methods are unrelated it would be awesome if we could just do them at the same time and uh so now you can we're introducing a new concurrency facade right into laravel so let's just see what it looks like I can say

00:42:22 values concurrency run I'll pass it into way an array of I want to be concurrent we'll say metrics G we'll do it five times let's just kind of get rid of this all right let's make sure we got the concurrency facade imported and let's hit the route now all right it only took one second because we're doing all of the metrics gathering at the same time and what's happening is the concurrency facade is Fanning out this work to other PHP processes in the background and then Gathering up the results and giving them

00:42:58 back to you all in one array but all of the work was done simultaneously so we can simultaneously run all of this expensive work at the same time and get all of the results and what's cool is it really doesn't matter even if we're Gathering more metrics here our response time is basically going to stay the same because we're running it all concurrently so we still just took a little over a second even though it really would have been over 10 seconds if it was run in order from top down all right so that's the concurrency facade

00:43:27 really simp simple way just to Fan out work across PHP processes especially unrelated work that you can just run simultaneously super easy to use all right let's go down to another concurrency route concurrency 2 um sometimes you have work that is sort of unrelated like I said um and not only is it unrelated you actually just don't care about the results of the work at all so this is again super common you're making some API call to report some data you actually are not expecting any sort of helpful response from the

00:44:08 service just like a 200 okay we got your data maybe you're doing that with a few different services and you're just not going to use these results again to show anything helpful to the user but they need to happen it would be awesome if we could do all of that concurrently but our users didn't have to wait so like right now if I hit this route you can see it ran in 1 second that's like it's slow right like that's not ideal um but the work is slow but since the user doesn't need it let's just do

00:44:36 concurrency defer now we're down to 29 milliseconds and all of that work is still being deferred to the background and it's being fanned out to run concurrently across multiple PHP processes so you could take advantage of both concurrency and deferring concurrent functions simultaneously it's really super slick and since we're using defer under the hood a lot of the same rules apply as when you're using the defer function so it's super consistent so if an exception happens down here let's say something

00:45:06 went wrong all of that deferred work will be canceled and we'll just discard it but again if you want it to run you can just say always and it will always run that concurrent work and defer it to the background it's super consistent super easy to use all right so that's an overview of the concurrency facade and laravel and it's an overview of a few of the new features we've been working on larl and we plan to ship all of these features in beta next week so that you can start playing with them [Applause]

00:45:44 immediately all right let's change gears a bit we've talked a lot about laravel the framework a lot of kind of back Endy uh type stuff let's change gears to the front end like I said laravel has awesome front end options right we have laravel Livewire which is like mind blow like when I first saw a laravel live wire in 2019 I was like my face like melted off my body I was just like so mind blown that this was even possible um and like I mean we can pull up this Live Wire route right um let's go to

00:46:19 slvt and let me pull up this example like if you showed me this code on the left 10 years ago at LaRon 2014 and said I could have this like realtime Dynamic component on the front end um that's persisting State using just PHP that looks like the stuff on the left I would have like I would have not understood how that was even possible or what the path to achieving that kind of functionality was in PHP so shout out to Caleb wherever he is on a truly blowing our minds uh with [Applause] Livewire but I don't want to spend too

00:46:58 much time on Live Wire not because I don't love Livewire but because Caleb talks in the morning and I don't want to spoil his fun or give anything away about what he's been working on but tomorrow I know because I've seen a preview um of the stuff he's been working on and it's going to be really awesome it's going to take your laravel Livewire experience to the next level I think and I think it's really been like the missing piece that Livewire has needed for a while so I'm excited for him to show it to you in the morning and

00:47:23 uh we'll talk about that tomorrow um so I'm going to talk about the other half of the larel front and story which is uh inertia how many of you use inertia okay good fair fair number of you which is good uh you're in the right place um laravel is an inertia is a way to pair your laravel back end with a modern react or view front end and it can be written in JavaScript it could be written in typescript you can even use zelt uh with inertia and inertia is really like this sort of connecting mechanism between your back end and your

00:47:56 front end so you have routes and controllers in your larl app just like normal but instead of returning a blade view you return like a react page or a view page and the array you pass to that page on your back end gets hydrated into the props of that page on your front end so the benefit of that is you get to enjoy all the like laravel server side routing data hydration all of that good stuff but you get to use a vast front-end ecosystem from a reactor view so you you get to tap into things like uh Tailwinds

00:48:29 Catalyst UI components to build really awesome front ends using their components you can tap into things like frame or Motion in react to build really great animation experiences on your apps but you don't have to leave your laravel back in behind and it all just like fits together like a glove and feels really cohesive and really nice um so in many ways I've always said that I don't think of inertia as a frontend framework um in the same way that like react or view or even live wire is a front end framework it's

00:48:59 really like this translation layer between your backend and your front end which is written in react and react is your front end or view um and because of that I've always said like I feel like inertia is just like kind of done like it's kind of finished software you know like some software is just complete and it works and it does what we need and there's just not a lot of other stuff to do um but I think I was wrong about that um I don't think inertia is done inertia 1.0 is great but there we actually

00:49:32 discovered there's a lot more cool stuff we could do so today I'm going to walk you through inertia 2.0 and I'm super pumped to give you the first public unveil of some of the stuff we've been working on all right so we've actually got a playground here for inertia so let's pull it up and I'm going to walk you through you weren't supposed to do not pretend you did not see that wipe that like from your brain okay it's gone I'm going to walk you through not one not two not three but as you can see

00:50:06 six new features coming to inertia 2 um and I think they're really slick uh Joe tanom and Jonathan renig the creator of inertia have really like knocked it out of the park working on these features and I'm going to give you a quick walk through of some of them but they're really pretty sweet okay the first one you're going to think this is boring but it's really like the foundational piece to the rest of all of these features and we call it async requests and I've got a nerd out with you for a second on how inertia Works to

00:50:37 help you realize why this is good right now in inertia one um every request is synchronous and no request can be happening at the same time as another request and if you try to make another request while a request is happening it's cancelled and in many ways that is good uh because it's sort of how traditional web applications work right you click on a link you wait you see the page you do something you wait for the response um that's like kind of how the web worked a long time ago right when we used to

00:51:09 build basic web applications but it can lead to some really like unexpected behaviors if you're using inertia so if you're using inertia to say like to reload some data on an interval like maybe you're on a page and you're reloading some data every second and let's say the user clicks on on a link and before the link can load the page your reload fires it actually cancels the link click that the user just made and I think many people are not aware of this behavior of inertia um and it can cause sort of subtle bugs in your

00:51:40 application so we're fixing that and we foundationally rewrote the whole request routing layer of inertia to make this happen so in inertia 2.0 all reload requests are async by default they happen in the background and they do not cancel other requests and they do not show progress indicators nerdy boring boo what does that mean okay the first thing it means is like on this links tab I've got these toggle buttons and I can toggle these really quickly and I get like this nice optimistic UI feeling experience and it doesn't really

00:52:11 matter how fast I toggle them none of the requests are stepping on the other request or canceling other request it just all works pretty much how you would expect and the way you tap into this in the code is you just throw this little async modifier on any Link in inertia and that says that request should be in the background and should not affect you know any other request and other requests should not affect it all right so that's async request in inertia 2.0 and I needed to preface with this

00:52:40 because it really unlocks a lot of other cool features that I'm about to show you so tapping into the power of asyn request we can really enable the next five things um and the next thing we're bringing to inertia 2.0 is an easy way to pull your data on a page um so let's go ahead and hit this automatic Tab and you can see I've got this like leaderboard of scores and you can see the scores updating automatically as that polling is happening um pretty simple concept right you can get pretty far with polling actually before you

00:53:09 have to reach for websockets uh when you're building a web application so how do you use this new feature in inertia it's super simple you just say use poll and you give it your time interval and what data you want to update and inertia will take care of the rest it will start polling when the page mounts and it will stop polling when the page unmounts and if the user Changes tabs the polling will automatically throttle so you're not just wasting bandwidth all right keep losing my screen um so that is

00:53:38 automatic polling you can also do manual polling so sometimes you want to be able to control when the polling starts or stops um so in this example you can see I have a start button so if I hit start we start polling on the page if I hit stop we stop polling the way that works is when you call use poll you can actually get stop and start callbacks that way if you want to manually control the polling Behavior it's super simple um so for example we might do this on larabel Forge when a deployment starts

00:54:04 we want to start polling for deployment output when the deployment is over we want to stop polling for deployment output we don't really need to be polling the whole time you're on the page all right so it's super simple just a start stop control polling everything works just use use poll in inertia 2.0 all right so that's an easy polling helpers in inertia next feature async request unlocks is what we call when visible wind visible is a convenient wrapper around the intersection Observer API that lets you easily trigger prop

00:54:35 loading when a p when a component comes onto screen when it Scrolls into view on the page that was kind of a mouthful so what is that mean so let's go to the demo as I scroll down this page you can see that I'm hitting a component and it's loading in when it comes Avail when it becomes viewable on the screen so we keep scrolling down the page boom that one loads in that one loads in this is awesome if you have something way down the page that maybe does an expensive eloquent query to load some big table of data you

00:55:08 don't really need to do that on initial page load like why not just wait until maybe the user doesn't even scroll to that wait till they scroll to that table then we can load in all of the data and makes the page much faster you get much like swifter response times for your users what does that look like to use so on the the server side we use an optional prop um this existed in in inertia 1.0 we're just saying on the initial page load you don't really need to calculate this prop you don't need to

00:55:36 run this query all right and then on the client side work that who said it that made it worse who said that okay the screen's been working hard today I guess getting tired um okay on the so server side inertia optional on the client side we can use inertia's new wind visible component so we ship this with inertia and we can say when this when this piece of the page becomes visible go a s inonly fetch this prop or this set of props and you can see we can even have a fallback template for our loading States and then when that data

00:56:34 is loaded in it will render the template that we pass into this component like I said we can even wait for multiple pieces of data so maybe when this becomes visible on the screen we want to go get the users and the teams a asynchronously we're going to have loading States and then the data will show on the page when it's ready and we can even use any of inertia's request parameters to say have finish or life cycle hooks if we want to tap in to the request life cycle of the wind visible component so it's super flexible

00:57:02 super easy to use and it will vastly speed up your applications for your users all right so that's the basic usage of the wind visible component we can get a little bit more advanced what if we actually want to have a buffer so we want to say when a component is within 200 pixels of coming on the screen we want to start loading the data so we want to start a little bit early so that it's ready by the time the user gets down to that section of the screen so that's what the code looks like we just passed a buffer prop and now as I

00:57:29 scroll down the page you can see I hit these orange arrows and that's the that's the threshold of the buffer and you can see the data is already loaded in so boom I hit the threshold data's loaded in so as we scroll down the page you know you get a seamless experience where the data is just always available and it's super easy to tap into and again will make your pages much much faster so that is inertia wind visible and inertia 2.0 I think it's pretty sweet all right we can actually use when visible

00:58:09 to build something else on top of this sort of like lower level component and we can use it to build really easy infinite scrolling experiences in inertia doing infinite scrolling in inertia 1.0 is doable it is probably not enjoyable or fun um but we're trying to make it that way way so we can tap into when visible and as I scroll down this page of pictures you can see that we just get more pictures and I can keep scrolling forever all right you've probably seen applications that work like this what

00:58:41 does this look like how does it work on the code side on the back end we have a new feature in inertia 2.0 called mergeable props and what this means is when I say A Nurse emerge and passes some data any other subsequent request to get that prop will appin the new data onto the data it previously retrieved on the client side so basically I can keep returning images and it will keep appending to the prop it already re received on the first page load and then on the client side I can just tap into when visible I don't

00:59:12 really need a new component here but I just put a wind visible at the bottom of my image list I can hook into the request parameters to increment the page I can say that I only want this data reloaded and I want to preserve the URL because as we scroll we don't really want the URL changing right this is like just one infinitely scrolling page so it's that simple to build infinite scrolling experiences in inertia on inertia 2.0 really [Applause] cool I'm actually going to back up here I showed you the view example for when

00:59:47 visible but for you react users you actually just use the suspense API to tap into when visible so we have suspense and you can use the use when visible hook to build these same types of experiences in react uh so this has both View and react support all right let's hop into the next feature one of my favorites inertia page prefetching I'm I'm very excited about this feature all right so let's hit the non- prefetch tab if we hit these different authors we'll see the standard inertia Behavior so like as I click each

01:00:22 author you can see the progress bar come across the top and we kind of have to wait for a second for the page to load again like that's like sort of fine right it's not bad but sometimes you want to prefetch that stuff um so we're letting you do that now really easily so let's hit the prefetch tab and there's a couple different ways you can do pre-etching the default way is on Hover so if I hover over here then I click I get the page instantly because as soon as I started hovering inertia fetched the page and cached it just to

01:00:51 be ready in case the user clicked that link so it loaded almost instantaneously this makes a huge difference in your apps we're already using this and some of the stuff we're building and you can like seriously feel the difference in the speed of the app when you start adding this to your application if you want to be super aggressive you can even prefetch when the page mounts so if you feel I guess extremely confident that the user is going to click this um you can go ahead and prefetch that page as

01:01:17 soon as the original page loads and it will just be instantly ready all right great but how do you use it so let's look at the code really easy on any link tag just throw prefetch on that thing and you will have prefetch on Hover behavior um by default we cash that response for 30 seconds and then we just sort of discard it because we consider it stale but as you can see down below you can customize that cach duration so you can make it longer you can make it shorter based on kind of what you're feeling for your

01:01:45 particular app or your particular data and if you want to do prefetch on Mount here's what that looks like so you can just say prefetch and then pass it Mount um and look at this bottom one this is an interesting one so you can actually pass two values to the cash for prop and that might look familiar it might look a lot like the cash flexible method that we saw earlier so what does this do and I think it's easier to show you rather than to explain it so let's hit the stale while revalidate Tab and this has two tabs

01:02:17 within it laravel and tawin they're prefetched on Mount watch what happens when I switch back to lar Val after 5 Seconds see how the data is gracefully updating after I hit the page the page is loading instantly but then the data is gracefully updating so what is happening is when you have a prefetch and you have a cash FL with two values if we click on the prefetch page in between the two values it will serve the cach page immediately from the cach and then gracefully reload the data in the background so that you

01:02:50 can provide this seamless transition for users that just refreshes as soon as they get there and this doesn't work for all screens but when it when it works it like really works and so things like charts and graphs and things it's usually fine if you just show the data immediately and then the graph just kind of like you like adjusts to the current time it almost like looks cool you know what I mean um so really powerful feature in prefetch um to let you implement that same stale while revalidate pattern on

01:03:20 your front end all right so that is inertia prefetching will seriously speed up your apps [Applause] okay I want to dig into one more feature of inertia 2.0 and that is deferred props it's another one near and dear to my heart all right so we have this non- deerred tab and if I hit this tab you can see again the like typical inertia Behavior where we sort of wait for the whole page to be ready and then we show the page again like not not bad I guess like we had no loading States every everything

01:03:56 just sort of loaded it felt like a traditional Old School web application but sometimes it would be really great if you could just show the page really quick and then load the data in after so we're making that super easy in inertia 2.0 so if I hit this deferred tab you can see boom we're on the page we have loading States and then the data Pops in when it's ready okay really great how do you use it on the back end you can just say inertia defer for a prop and that will make that a deferred prop and then on

01:04:29 the front end you can use our new built-in deferred component to specify your loading State and then what should render when the data is ready and you can see that you can even wait for multiple pieces of data so you can say this piece of the page we're waiting on the Deferred data user count and Order count we can give it a loading State and then we can show the data when it's available now you can see well before I move on let me show you the react so again we tap into suspense and we use a new us deferred hook and we can tap into

01:04:58 all of the same deferred prop features as on The View side let me close the code and reload the page again you can see how all the Deferred data popped in at the same time so the stats across the top popped in at the same time as the user table across the bottom so the default behavior is when you have deferred props enertia will go out to the server gather up all the Deferred props in the background send them all down to the client at the same time sometimes that's fine but sometimes you might want to group the

01:05:25 data into certain deferred groups so let's hit this other tab you can see that we get the table and then we get the stats when it's ready so inertia 2.0 lets you assign keys to your deferred props so that you can group them so maybe you have some stuff that takes a lot longer than the other stuff put that in its own group and then the other deferred props don't have to wait on the really slow one they can just render as soon as they're ready and it's all super easy to use Easy to declare loading

01:05:53 States it all just works so that's a Ina deferred props in inertia 2.0 so that's a preview of inertia 2 async requests polling when visible infinite scrolling prefetching and deferred props with View and react support for every feature um again I want to thank Joe tanon bomb and Jonathan renck for absolutely knocking this thing out of the park I think it's going to be awesome breath of fresh air for inertia users and we hope to have inertia 2 in your hands in early October not that far away by the way okay it's

01:06:35 we're getting into September so pretty soon you'll have inertia 2.0 in your hands and you can use all of these great features all right so that's inertia 2.0 and a round of framework updates from the laravel team [Applause] so I'm super excited for the future of laravel and front end and design has always been super important for laravel both on the code side and like in the true design uh sense of the word on the front end so for code designing really expressive enjoyable apis has always been like super a super big passion of

01:07:18 mine I want the code to feel really enjoyable to write really memorable it's just fun to code in laravel and when we build products we want the design to feel really great to feel really polished to feel really thought through um and as part of scaling larel this year I've been super pumped to bring on a new head of design and I'd like to invite him on stage just to share a few words with you about how we're thinking about design going forward at larel so I'd like to W welcome David Hill to the

01:07:50 [Music] stage everybody get up it's time to slam now we got the real Jam going down welcome to the Space Jam here your chance okay hey everyone this is exciting um my name is David Hill I'm head of design at lville I'm super excited to be here today when Taylor asked if I wanted to say a few words and my immediate response was I'd love to but first before we jump in just a couple of important house rules they're really simple the first rule of larel design Club is we do not say the word pretty floran you and I we can have

01:08:40 words later the second rule of lar design Club is we do not say the word pretty we do not say the word pretty design is so much more more than the way things look design is the way things work it's problem solving at every level of an experience it's what makes a brand feel like a brand it's the attention to detail you give something when you think people couldn't possibly notice because I can promise you people will notice whether they know it consciously or not it's the hundreds and thousands of tiny details that don't

01:09:22 matter individually that collectively compound over time to create something think that does matter and well just ask Jason begs hey Jason can we take the padding on this icon and change it from 8 pixels to four or for those of you who only speak Tailwind P2 to P1 hey Jason that icon can we make the SVG animated to give it a sense of motion or hey Jason that animation can you tweak the transition to make it feel swish like my jump shot because design matters and design is a differentiator and great design

01:10:08 well great design requires more than just design great design requires time because our first ideas are rarely our best ideas more often than not they're just the obvious ones the ones we need to push past in order to get to the good stuff and great design requires teamwork and collaboration across all levels of an organization it can't just be the final step of styling something great design requires empathy and humility and as with anything done well requires extraordinary amounts of effort now laravel has always done a

01:10:46 great job of design it's What drew me to the framework back in 2019 when I started to use it and yes designers should code just putting it out there but a big focus of my role is to continue that great work and with the help of everyone at laral and the community to push the design of our products and experiences forward to make them even better now outside of all the great product work that we've been busy cooking and we've been busy there are three upcoming projects that I'd like to share with you

01:11:22 today the first is a laravel brand site for those of you that work with larel brand we'll be introducing a site where you can download templates and resources to help you and to help M maintain brand consistency the second which I'm really excited about is a complete refresh of lal.com not only will we add value and explain the value that we add we'll also introduce a sense of artistry poetry and elegance all the values that we try to embed in the framework itself and third let's not forget the laravel

01:11:59 docs laravel documentation is world class it's one of if not the best documentation sites out there but we think we can make it better and we need your help so whether you're a junior developer making your very first laravel application or you're a gnarly seasoned Pro who's been using the framework since V 1.0 we need to hear from you we'd love to hear your thoughts feedback ideas and suggestions the good and the bad so reach out and let us know laravel design is just getting started and I can't wait to see where we

01:12:33 take things with that being said I'll hand you back to Taylor enjoy the rest of Lon thank [Applause] you all right thanks David we've covered a lot today um I hope you're super excited about the future of laravel I feel like I've never been more excited about what we're building as a team as a company and as a community we've seen some pretty awesome new additions to our ecosystem our first party vs code extension container attributes deferred functions caching improvements the concurrency faad inertia 2.0 with async

01:13:22 requests polling infinite scrolling prefetching and deferred props but as you might be suspecting I do have one more [Applause] thing and that's shipping laravel developers I feel like are known for just freaking shipping shipping good apps working fast knocking things out you know what I mean like I just feel like that that just resonates with laravel as a community and as I said 10 years ago at laral 2014 I launched laral Forge and it was a product that changed laravel it changed my life um it really like kickstarted

01:14:06 the whole laravel as like a serious thing let's say um that I'm working on full-time Forge made it super easy to ship and manage applications to manage servers virtual private servers on cloud providers like AWS digital ocean hetner and others um and we remain fully committed to that story um we think developers should have the freedom to ship their applications really easy to a cloud provider of their choice and just manage a good old-fashioned server and Forge is awesome at that five years ago at larcon 2019 we

01:14:44 launched laravel Vapor again let you bring your own AWS cloud account attach it to laravel vapor and ship your application out to AWS Lambda to tap into the full power of serverless full stack PHP applications for incredible scale on both the web request and the Q layer and these are awesome tools that we continue to have great ideas for and we have exciting new stuff we're shipping to these tools soon but over the years I've always dreamed of something just a little bit different than Forge and

01:15:18 Vapor um ultimately a lot of laravel developers shipping apps don't want to worry about AWS I am credentials or digital ocean accounts or engine X configurations or load balancers or networking or firewall rules they just want to ship I just want to ship we just want to ship and I think the next generation of laral developers they just want to ship awesome applications out to the world scale them and secure them really easily and that's been our Focus for a while just ship and it's what I want our

01:15:58 theme to be going forward for laravel and I believe that laravel developers deserve amazing products so about six months ago I started thinking what if we just built what if we just built the platform that we've all always dreamed about for shipping laravel applications so back in February I sat at a dinner table in Amsterdam with Joe Dixon one of the lville team members and he asked me like what's the number you'll be happy with and what he meant was how long do you think it should take from a new user signing up to such a

01:16:38 theoretical platform to having an app out and running on the world with a sharable link that they can send to their friends or their teammates and I said one minute or less one minute or less like from sign up to having an app out there with a URL a honesty goodness app one minute or less and that became our Northstar from signing in to shipping from Hello World to hello web it should be one minute or less and I'm happy to report we hit that goal and we hit that goal with quite a few seconds to spare

01:17:18 actually and so today I'm excited to show you for the first time the next generation of shipping larl apps and that's laravel [Applause] cloud laravel cloud is a fully managed infrastructure platform for shipping and scaling laravel apps and for me it's a dream come true um and I hope you like it too we have had a blast building this thing and I think the best way to learn about it is just to see it so today I'm going to give you the first preview of laravel cloud live from this stage this is an early version of

01:18:02 laravel cloud but it's looking pretty dang good if I do say so myself so let's just jump right in to the first demo of laravel cloud all right here we go let's pull up the old secret bookmark boom this is the laravel cloud dashboard you can see that I already have a few apps out here um let's dig into the beep app you can see how fast that loads this is an awesome awesome app to use and David and the design and front end team have knocked this thing out of the park about really thinking through the design

01:18:39 and flow of this application and you can see here we have an overview of our app we have some stats about the app we can see some of the previous deployments that were made to this app it's all really great so let's go back to our dashboard we don't really care about these existing apps we want to build new stuff so let's go to add new and we'll just add a new application I don't have to link anything else I don't have to add any AWS credentials I don't have to add a digital ocean account ocean account

01:19:08 I'm just going to add a new GitHub repository so let's go ahead and pick this repository LaRon demo I've already linked my GitHub account I'm going to name the application LaRon I've got my region here in Us East and I'm just going to say create application all right I'm here on the the application dashboard or landing page and you can see Cloud kind of gives me this little wizard for walking me through configuring this application a little bit we're not going to use that right now I have time to sort of

01:19:36 configure the app if I want to but for now let's just deploy it since laravel cloud is fine-tuned for laravel most of it is just zero configuration this is the platform that laravel and PHP developers have just always wanted the ability to ship really quickly all right so we can see that our application is building it's deploying out to laravel Cloud we can see all this build output here we can see that our stack is provisioning it's getting our cluster ready to serve our apps that's now finished all right this app looks good

01:20:11 to go you can see we have a ll. cloud URL here with a nice generated URL we hit the page boom we have a Lille app up and running and to deploy that app just took us 25 seconds 25 seconds from signing into laravel Cloud I picked a GitHub repository I hit deploy 25 seconds later we had a laravel do Cloud URL that we could share with a teammate share with a friend to access our application our next big idea let's go back to larabel Cloud what else can we do here let's go back to this applications dashboard I'm in the

01:20:54 laracon project setting screen you can see here across the top I can actually like change teams so right now I'm on my personal team where I have my personal projects I can change between the projects that are on this team really easily the whole app is just so thoughtfully design thoughtfully designed and easy to use so what else can we do I mean first things first let's talk scaling right our next big idea is going to be really big so we want to scale up this app how do we make that happen in laravel Cloud we'll just

01:21:23 go to the settings page and go to web we'll edit this app we get this nice little fly over here let's scale up maybe to the medium size and we'll make 10 replicas of the app on larl cloud so 10 instances serving this app all right so if we're good with this let's just hit save and we'll hit save and deploy and that's provisioning our fresh application stack we've scaled the servers vertically and horizontally so we've upped the power of the servers and we're deploying to 10 replicas across our cluster and you can see our app

01:22:02 redeploying and once it's deployed we can hit the app and we've already scaled up to be able to handle more traffic on larel cloud it's that easy to build scalable applications all right and this deployment is finished all right so our app is scaled up super easy and on the web tab you can see we have high hibernation here make that a little bit bigger for you we have hibernation if I enable app hibernation I can tell Cloud to put my app to sleep if it hasn't received traffic in a specified amount of time and the cool

01:22:40 thing is I'm not paying for compute while my app is sleeping so this unlocks so much freedom for larel developers and it was a must have feature in my eyes for this platform I want every developer to be able to ship their test project projects ship their side projects ship their staging environments and you only pay for the compute you're using so you never have to worry about H do I really want to ship that side project to laravel Cloud you can put all of your side projects on laravel cloud just turn

01:23:10 on hibernation if they're not being used you're not paying for any compute really [Applause] great all right this is our Branch pop this open and a blind text and what should we do here we'll come to our routes file I'll just make like route get uh new route all right I'll fix my typo here and uh we'll just return like hello LaRon all right so we've got that in new route we come back to git we have modified this file so let's commit that new route we'll push that up to GitHub all right cool that's been pushed

01:24:02 up and now if we come back to Cloud you can see up here I've got main that's the branch we're currently on great so we pick new route it will give us an environment name let's just hit create environment we don't need any help setting this up we'll just hit deploy all right and now our branch is deploying on its own separate infrastructure separate from our other main branch and you can see it's deploying out that Branch we get our build output and then it's going to deploy a compute cluster for this new

01:24:45 Branch all right it's provisioning that infrastructure all right so this is out there uh you can see we have a new lol. Cloud URL so every environment gets its own unique lol. Cloud URL that you can share with teammates or collaborators and it's separate from your main branch URL so let's go ahead and hit that out and hopefully we can hit the new route URL and we get hello LaRon so it's super seamless super painless if you're team is working on a new feature to just throw that feature out on laravel cloud let your team test

01:25:30 it out sign off on the feature and then ship it out to production it's all really great and really fast all right let's go back to this app's dashboard and maybe let's just switch back to the main environment our main branch what else do we need to build a laravel app um well we're full stack developers right we might need a database um so how do we do that in laravel Cloud what if we want to add a database to this app in this particular app is using laravel Breeze one of our application authentication starter kits

01:25:59 so we should have a user profile dashboard ready on the app but we do need a database to power it let's go back to settings if we go to the database tab you can see that I can just hit enable database and that unlocks another selection combo box where I can select or create a database okay I'm not going to use that database it will show me some of the existing ones I can use I can always attach a database that maybe another app uses if I want to share databases across apps for this app let's create a brand

01:26:27 new database you can see we get a few options here we're going to create a laravel serverless postgis database I'm sure many of you know that postgis is a very popular open source database maybe the most popular open source database among developers today with larel serverless postris we can create a database that auto scales based on your application's needs both for compute and for storage so you don't really have to pick any compute size or any storage size up front we can just create a serverless postgress database

01:27:01 it's all managed by larabel Cloud you don't have to worry about the infrastructure let's go ahead and give this database a name we'll call it laracon all right and we've got a region and you can see right here we have a sleep after value so not only can your apps hibernate your database can also hibernate and if a request comes in while your app is hibernating we wake your app up in seconds and Route the request to the app and the user gets a response they don't get an error it's the same with your database if your

01:27:30 database isn't being used we can hibernate your database so that you're not paying for any database compute while it's hibernating this means again you can ship all the side projects you want all the staging environments you want if it's the weekend and your developers aren't working on your app you're not paying for database compute your database is asleep that's awesome all right so let's go ahead and create this database I want you to watch how fast this happens we hit create database see this toast right here the database

01:27:58 is being created and now it's gone that database is ready to connect to locally even from like table plus I can connect to that database already it literally takes a matter of about five or six seconds to have an autoscaling postr database on laravel cloud all right so I've attached this database to the app let's just go ahead and hit save all right so we've saved that change it hasn't taken effect yet because we haven't deployed the app there's one more thing I want to do I want to come to the deployments tab and

01:28:31 I want to run my migrate my migrations as a deployment step if we're going to have a database we need to migrate the database every time we deploy so let's go ahead and enable that this time I'm going to hit save and deploy all right so it's deploying those changes and since we enabled a database and attached a database to this app Lille Cloud will automatically inject the proper environment variables into the app there's no other config figuration we need to do our app should just be able to connect to this database

01:28:57 straight away as soon as our deployment is finished so we're going to wait for this to finish it's looks like it's deploying the cluster now all right and this is deployed so let's go ahead and close out these old tabs now if we hit this app you can see we have a login and register link because our app detected we have a database and lar Lara Breeze I should say detected that we had a database so let's go ahead and register all right and we're logged in we have a serverless database backing this

01:29:36 application so we can hit the profile screen you can see everything feels really Snappy it feels really fast we have a database it's all working on laravel cloud in a matter of seconds and when our apps not being used it can hibernate so we're not paying for that compute all right so that's how easy it is to attach a larel serverless posters database to a larel Cloud app which I think is just a huge leap forward and how we ship and scale [Applause] applications all right we've added a database what else might laravel

01:30:17 applications need we might need CU jobs on this app I actually have a podcast cash route and on this route we get this cash GPT screen where we're using chat GPT to generate podcast name ideas okay so we'll feed it a topic and it will give us a podcast name based on that topic so let's try a few we could try I don't know let's try laravel or maybe Seinfeld uh what else maybe Dolphins what else Star Wars Star Wars all right all right so we got four out there that's good but you can see it's just spinning and

01:30:56 it's because we've queed a job to generate this podcast name but we haven't actually configured a q worker on laravel cloud so let's do that now let's go back to Cloud we'll go to settings and let's go to web we'll edit our web instance and if we come down here to the demons area we can add any demons we want on this web instance so PHP Artisan Q work database and we can we can even say how many processes let's scale it up maybe we want 10 Q processes on all 10 replicas so that's really a total of 100 workers running across our

01:31:34 infrastructure all right and let's just save and deploy Lara's going to build our app and it's going to provision all of the demons that we can figure and we're not limited to dis Q's we could run any kind of demons we want across our infrastructure super super easily Lille Cloud will make sure they're always running and that they're Grace y restarted if they go down and larabel cloud is a serviceful server full architecture your applications on larel cloud have dis that they can write to persistent dis you can use any laravel

01:32:08 feature you want you can store files locally if you want it's truly a platform built for developers by developers all right so this application has deployed and you can see we got our podcast because our queue is up and running so we got Wookie wins and bantha banter for our Star Wars podcast Seinfeld Shenanigans down there and laravel laugh okay some great podcast names all right so we've got cues up and running but you'll notice that when I configured these demons I put them on the web instance so we actually let you

01:32:43 configure Q workers on the same cluster that is serving your application's web traffic but sometimes you might not want to do that so larabel Cloud also lets you add dedicated workers this is separate infrastructure that's not serving web request where you can put any Q workers you want or any other long running tasks so let's add a worker I can name it qes since this is going to run my cu's I can pick how big I want these servers to be and I can specify how many replicas I want let's do three workers I can say if I want the

01:33:16 larel scheduler to run on these workers and I can add any Damons I want PHP Artisan Q work database give it five processes a piece and let's save and deploy now we've got not only as our web layer running Q workers we're provisioning dedicated workers that are also running our Q jobs and we can build as many replicas as we want for this application to build as much scale as we need to to handle our customers needs and everything is smooth and maintained by larel Cloud you don't need to worry about

01:33:55 SSL certificates every laril Cloud app and ll. Cloud domain comes with free SSL and free basic DDOS protection powered by Cloud flare under the [Applause] hood some we've killed our Cast app by deploying a worker all right we'll figure that out later all right let's go to something that I think you'll all be interested in is one when can I use this and two how much is it going to cost all right so let's go back to my slides first the costs our sandbox plan has no fixed monthly fee you just sign up to laravel

01:34:47 cloud and you have an account and you run all the apps you want and the compute starts at less than a Penny an hour to run your laravel apps with laravel serverless posters starting at 4 cents an hour and 75 cents a gigabyte this includes all the ll. cloud domains you want and it includes app hibernation and database hibernation so that you only pay for what you what you use so everyone can sign up for laravel cloud and deploy all of the projects you want if they're not being used you don't pay

01:35:18 if they're being used you pay nice predictable pay as you go pricing for compute and for database our production plan autoscaling compute supported larger instance sizes and custom domains we'll have a small fixed monthly fee and then the same pay as you go understandable pricing no hidden bills pricing you can actually understand and we'll be releasing bandwidth and file storage pricing later this year so if you we want Early Access and we want customers on the platform shipping applications and Early Access later this

01:36:01 year if you want to be one of the first people to get access to laravel Cloud go to cloud. lal.com and join the Early Access list that is the best way to stay updated about what we're working on on laravel cloud and what you can expect from the platform so that's laravel Cloud what do you think [Applause] it's really been my privilege to share all this hard work that the Lille team has put in building this amazing feature for the framework for inertia for cloud our design team our vs code extension so

01:36:45 much work that the team has put in over the last six months and I want to thank the laral team especially for all the work they've done it's been a privilege to work with all of you on these products we have a little bit more to say about Cloud so if you bookmark this link we have a special behindth scenes interview between me and Aaron Francis our LaRon MC we're going to debut this next week it goes into the whole backstory of why we started building Cloud why now how we're making it happen and I hope you enjoy it's a really it's

01:37:15 a really fun interview with Aaron and that's going to be out next week on YouTube bookmark this link so you can see it as soon as it premieres so we've seen the future of laravel I hope today awesome new framework features our commitment to open source with our vs code extension inertia 2.0 a breath of fresh air in a frontend world that often feels like it's gone mad and the future of shipping applications on Lille Cloud where every new developer coming into the Lille ecosystem can just ship can just ship

01:37:47 their next big idea their next big startup and so the Enterprise teams can scale their applications on laravel safely and securely and be able to sleep at night so what about debugging observing and monitoring those applications that are in production for that tune in to LaRon Australia in November because we'll have a lot more to say on that topic thank you everyone nice job um so like Taylor mentioned we do have a full interview coming out next week but if you're up for it I just have a few questions okay

01:38:31 um you opened by saying that the ethos of laravel is to ship ship fast you said that y'all built this in 6 months yes how how how many how many members of the team were involved in that um and what is I know what the back end is what is the front end so I would say probably there's around 10 of us involved on the cloud team um but but all of us on laravel the whole team has of course pitched in their ideas right we're all laravel developers at laravel we love laravel and we know what we want we know what

01:39:04 we've always wanted in a shipping platform so the first commit to Lille Cloud repo what you saw today was in April actually as far as the front end goes um the infrastructure team started working on larabel cloud a little bit earlier than that but it is like it does blow my mind how much our team has gotten done so quickly to essentially rebuild a cloud platform for laravel from the ground up so while running like three or four other classes a huge running yeah all of our open source and other products so I'm extremely proud of

01:39:33 the team it's my uh honestly honor to work with people that are much smarter than me on a much daily basis on a everyday basis so yeah I I just it's been my privilege to work with the team on this that is incredibly fast um second question do you think um do you think this will be an inflection point when we look back on the history of larel I think so um when I think back to when I first started shipping PHP apps it was very common for new web developers to start on PHP um it was just a very common entry point into web development

01:40:08 and lately it feels like not as many people are starting on PHP and one barrier to that is the ability to ship these apps uh really easily developer expectations have changed and since we launched laravel in 2011 and since we launched Forge in 2014 the developers just have different expectations on how easy it should be to go from their local machine to production URL um and if it's not like a button click they're like noing out at this point you know um so we knew we needed to build a Next Generation

01:40:38 platform for shipping larel apps because like I said I believe laravel is the best way to build production full stack applications if you want to be productive if you want to ship fast you need to be building on laravel and we want to give you the best way to deploy that app that makes it as painless as possible to go from your local machine to production okay I love that last question um so Lal team has been cooking let's give it up for the laral team by the way they have clearly been hard at work

01:41:12 um so the team has been cooking you've been heads down this is the the realization of dream what is your charge to the laravel community as this inflection point happens um well first thank you for believing in laravel um I think the fact that laravel is 13 years old at this point and this is the biggest LaRon us we've ever done and people are talking about laravel and PHP on Twitter and or on X and they're not joking about it you know all the it's like actually considered a serious way to ship apps and the fact that we're

01:41:48 standing in this position all those years later I think is a testament to this community um the tool we've all built together and what we believe in as far as how we like to work and how we like to ship and so I mean I guess my charge to the larel community was let's keep working on this thing like I think our best days are ahead of us and I think the future for larell is going to be pretty amazing and the future for PHP is going to be pretty amazing y'all give it up for Taylor otwell


The founder of Laravel, Taylor Otwell, announced framework updates and 3 major releases at Laracon US 2024 in Dallas, TX.

https://cloud.laravel.com

Also featuring Joe Tannenbaum & David Hill.

Laravel Cloud, Intertia 2.0, VS Code Extension, & OSS Updates - Taylor Otwell Keynote at Laracon US 2024