Getting Started With Laravel and Inertia.js | 1-Hour Tech Talk

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Inertia is fucking amazing.

👍︎︎ 8 👤︎︎ u/crnkovic 📅︎︎ Apr 20 2021 🗫︎ replies

damn this is exactly what i was needing today

I almost had written off vue because i didnt want to be passing data over an api all the time

thanks

👍︎︎ 3 👤︎︎ u/DeeYouBitch 📅︎︎ Apr 21 2021 🗫︎ replies

I was just setting up Laravel and Inertia.js on Digital Ocean yesterday. What a coincidence

👍︎︎ 2 👤︎︎ u/CLEVELAND-99 📅︎︎ Apr 21 2021 🗫︎ replies

Awesome talk, thanks!

👍︎︎ 2 👤︎︎ u/leydenjar 📅︎︎ Apr 21 2021 🗫︎ replies
Captions
hello hello testing123 welcome everybody all right well uh happy tuesday everyone welcome to today's tech talk with digilotion and myself my name is chris sev i'm a developer advocate at digitalocean and we've got some people in chat already shouting out where they're coming in from please everybody join in hello daniel from portugal all the way over there michael from denmark all the way over there gonzalo from mexico welcome welcome oh we got spain up there from ghee gee hopefully i said that right welcome everybody i am hailing from las vegas nevada the city of lights and casinos and all that good stuff welcome today's to today's tech talk oh kenya ghana i love the african communities out there hi from romania daniel jonathan ooh jonathan here is the author founder of what we'll be talking about today so no pressure huh hey jonathan welcome to the stream hey ian from boca chica texas um boohamadu from senegal over on linkedin welcome everybody in today's tech talk i want to talk about something that is really really a fun topic and it kind of is really interesting because it changes the way that you think about building applications these days and i think this is a long time coming uh calculus right on love you all um i think this sort of mentality with inertia.js is a long time coming and i think it's very brilliant as far as how we can build modern day applications so let's get started hey freddy from guatemala everybody welcome welcome welcome we're going to have a lot of fun today so laravel is a php framework that i personally love and enjoy working with i built a website using laravel called scotch.io we got up to about four million page views monthly all on laravel so laravel as a tech stack is fantastic for building out uh any sort of application that you like so um let's talk about the way the world has gone in the past javascript land of maybe four or five years so we've had laravel and the kind of these monolithic stacks right where you have uh all of your tools in one framework uh and what's ended up happening is everybody's kind of moving into this jam stack world because jam stack is fast it's secure and it um lets us deploy static sites globally which makes it really really fast for our friends all around the globe all of you in chat and that's kind of one of the big things i had to deal with when working with laravel building out scotch.io which was a global website is how do we get um static and quick sites across the globe so we ended up doing a little bit of static generation there which actually took a lot of work um but what ends up happening and let me pull out my notes and when i say notes it's just a vs code file um so what ends up happening is you have the monolith way right and then you have the everything under one framework and that's as far as your routing your front-end views your back end service and your routing and your front end view so we have three things right we have one two is routing to get around your application and three is your front end so your back end your front end and your routing and um this is kind of the monolith way and then if you look at the jam stack way which the javascript world has been going rightly right we're going to say uh kind of more of the separation of concerns way so what that means is your backend service can stay turned into an api which can be done with like laravel uh ruby on rails whatever you use laravel here and then your routing is done in laravel and then your front-end views is done in laravel or whatever back-end that you're using damn segway kind of says look let's build an api where we send data to our front end um any front end but we're now decoupling the back end from the front end and that can be like react or javascript as far as view and in today's tech talk we will be using view so if you're if you've seen it in my previous tech talks i usually lean react but today we'll be using vue just to kind of switch it up um and i guess that's three here so two here is going to be where is our routing that kind of moves to our front end uh application as far as react handles the routing there so this is kind of the two different ways to look at things and if you are looking at the jam sec way which if you've built a jam stack application lately you get all of these problems and i don't want to say problems i guess i want to say work to do in your api layer because right here your api layer is how you connect the back end to the front end through an api layer but now your api layer needs to have authentication authorization all that kind of stuff miracle what's up boris love welcome uh let's see so yeah you have back-end services an api layer that you have to build out now and routing uh sorry your front end application which handles the routing so now what we end up happening is we have two github repos we have the back end repo and you have the front end repo and now you have to deal with deploying two separate applications right and you also have to write a lot of stuff a lot of the stuff in the api layer is rest or now you see a lot of graphql coming out but that's a lot of stuff to be learning writing about kind of a paradigm shift from what you know and a lot of this is like i'm coding more now because i have to build two separate parts of my application wouldn't it be amazing if we could just say look we can keep the front end in reactant view in javascript land we can keep the back end as laravel but let's just delete all of this stuff right here in the middle and make both of these magically work together and those are supposed to be like magic signs so that's essentially what inertia js is doing for us it's saying look there's a lot of writing that you have to write in here let's see if we can get rid of it and pair the back end and the front end all without writing so much code so today let's build a real-time messaging app and we're going to build that using laravel and inertia and vue.js and i'll show you all the things all the cool things about inertia and why i really really enjoy working with it so let's get started oh from taiwan welcome welcome to the stream thanks for joining everybody okay any questions on kind of the jam stack way versus the monolith way so if we go back to uh and anytime please throw questions in the comments i'm happy to answer them as i go along and also there will be a section at the end of this tech talk for comments and also this tech talk is recorded and will live on the digitalocean youtube channel all right so let's get to inertia.js.com and i'll post a link in chat here if you want to follow along with me so inertia is the modern monolith is kind of what they're billing it as and i think that's pretty accurate it's building monolithic applications where everything is easy to build because it's under one github repo it's all in one location and you still get the benefits of using like your front-end application so build single-page apps without building an api and that is actually a really amazing thing because an api is so much work and a lot of code goes into it let's get rid of it so let's get started i want to get an app up and running i'm going to go into my level apps directory i'm going to say laravel new inertia we'll let that run all right so that's uh there i'm gonna go [Music] open this up in vs code which is my editor right here and let me zoom in so we have a bare bones uh starter laravel application i'm going to hide the status bar hide the activity bar okay so the first thing i want to do is set up a database and we are going to build a messaging application um i guess you could call like a chat app if you want we're gonna set up our database real quick i'm gonna go to environment database connection i'm going to remove all of this and just say sqlite we're working locally it'll be easy enough database you file database that sqlite the scene what's up welcome akilesh welcome from india okay so we have sqlite as our database we have that set up um now next thing let's go ahead and build out our model our migration and our controller for our messages so i'm going to say php artisan make model and we're going to say migration we actually don't need the controller so i'm just going to do the m oh oops i forgot name so we're going to call this message we have created a model and created a migration and this is just quick setup for our laravel application so we can get our models and stuff this is not really the focus of today's tech talk i do have previous tech talks on getting started with laravel uh building a layer of l api um using laravel databases and you can find those on this channel uh ryan olsen with the question why aren't you just using jetstream to start uh this really isn't focused on jetstream i jetstream adds a lot that you have to kind of understand and we really want to just focus on inertia itself today um i do have a previous tech talk on jet stream actually if you want to search for that on this channel we've done a lot of layerville on this channel okay so we have our message let's go set this up and then we'll start working with inertia so i'm going to go to message um let's go down here we're going to say detected fillable is equal to message or sorry text each message is only going to have one property it's going to be text and then let's go over to messages table and then i'm going to set up our migration we're just going to say table string message or sorry text i keep doing that and we'll make it nullable for here okay so we have our message we have our messages table and that's all good there i think that's enough to set up our database so let's go php artisan migrate all right so we have our messages table all that good stuff there all right let's see what else do we need for setup um i want to let's start working with our routes so next up here let's just talk about building out a laravel application so if i go into routes right here and i go into web here is our get file and actually let's go and view this let me spread this out right here i'm going to break this out here and i'm going to break this out here and abdul basit says what theme am i using for vs code i am using monica dot pro i come from the sublime text days and i'm a big fan of monacai cool so we have that going let's go and test this out inertia.test and here's our brand new laravel application so that's all good there okay so next up let's say we have our route get where it returns the view called welcome how do we um go from route get here to route get about return view about and i'm gonna go over to my resources views and create an about.blade.php so this is traditional laravel application i am the about page uh and then we're gonna have an a tag here href is going to go to the home page go home and then in our welcome.blade let's go over here and just go down here a lot of stuff in this boilerplate huh down here and then just at the top of this thing let's do an a tag right here ahref about um harold says why not phpstorm phpstorm is awesome i just like vs code it's preference okay so if i go over here here's the about page i click this it goes to slash about and i go to the about page i click home and i go to the home page but this is kind of a traditional laravel application right and then if we go to web.php and we say okay well let's go to our about page and let's go grab all of our messages so we're going to say messages is equal to message and i'm going to auto import app models message right there all and pass that in as this messages messages like that okay so what we have here is uh passing in our messages array into our view called about so we've gone to about and i know my name is all weird so we can say a four each um oh my gosh i'm forgetting my laravel syntax for four reaches this is what happens when you spend too much time in the javascript world okay so it is messages as message and for each and we'll say message text so this is kind of how you can show all of your messages on the about page we don't have any currently but that's okay because this is good enough to just show on our about page really nothing and that's okay so let's go over here we're going to create let's do one real quick message create text hi everybody thanks for joining okay so that'll create one on refresh and there we go there's our message right there uh and if i just refresh it'll create a bunch in the database okay but the thing is here is this is how we build out a laravel application right we have our eloquent models go grab database information send to our blade views so let's start talking about inertia and why inertia is cool right here we are basically routing from home page to about page and it does a page refresh every time if you're building out modern day javascript single page apps you're never going to see that page refresh it's all kind of one seamless um experience right there hey bobby what's up thanks for joining okay so let's go ahead and go to the inertia docs and let's walk through the installation and if you have some time check out the core concepts who is it for how it works and we're going to go over how it works after the install so let's go server side here basically you just do a compose require inertia laravel so let's grab that go here paste that in and that install is good sweet let's go down here we need a root template and let me copy this and i'll talk through this right on bobby you came right at the perfect time we are just now starting the inertia install what we've done is we have a home page in laravel we have an about page in laravel and now we're installing inertia so let's go over here inertia wants one view file so i'm going to say new file app.blade.php and by default this is the file that it wants and here we have an application where we are adding in our app.css we're adding in our app.js which is pretty much where our app is going to live and then it says inertia here so inertia setup for our blade template this is all we'll need and everything else will be handled inside of view templates so from here we are done with blade now we set up middleware this is real quick it's that in and the docs do a great job of explaining all of these things definitely read through them when you get a chance we have to add middleware i go into the kernel file in app http and at the bottom of our web array right here let me zoom out we're going to add the inertia middleware okay so on the back end we are done with the inertia setup let me double check yes we are done with the inertia setup on the back end so next up we need to install inertia on the front end so i'm going to go client-side right here i'm going to install right here inertia and inertia view and let me zoom in here so let's copy this and i promise this is going to get good this isn't just going to be me walking through the docs this whole time i'll paste that in cool let's go down here initialize app so now we are going to copy all of this and i'll walk through it real quick we're going to go down to resources javascript app.js we don't want this bootstrap file anymore and let's delete the bootstrap file actually okay so this is going to be the start of our view application and it's going to be using inertia so inertia exports this app component and we're basically going to say in our div render our inertia application and this is the setup that's required for inertia and now inertial will take care of the connection between the back end laravel and the front end view so let's scroll down here progress indicator is cool let's go ahead and install this and paste that in and this part's not necessary we'll just install it though there okay so that's it for app.js and let's see code splitting could set that up later but that is going to be it for our inertia setup so install on the back end install on the front end create app.blade create app.js okay any questions on any of the installation i do want to do one more thing because we don't really like building out ugly demos around here so i'm gonna go to tailwind i'm gonna go grab get started installation i'm gonna go down to get the cdn file which is not recommended for production it's too big of a file but we'll make it easy here and i'll go into app.blade and paste that in right there so we have tailwind now our app should look decent all right so that setup that's talking about how laravel uh currently traditionally works let's close everything out and now we have inertia installed brand new laravel app let's start working with inertia so i'm going to go into web.php and we're going to say this is the laravel monolith way okay i'm going to delete all this let's start talking about the laravel inertia way so let's create a route we're going to call it hello return inertia and i'm going to use the inertia helper here i'm a fan of the helper's way you could also do inertia render like this but for me i personally just use the helpers and what you do here is you're going to say i want to give you a view component to load up so we're going to say hello is our view component and that's it so let's go create a view component resources javascript new folder pages so it is required to have this pages file and the reason for that is if you go into app.js it actually looks in the pages folder right here for whatever file uh component that you're creating or that you're loading okay so let's go over here pages and i'm going to say hello dot view now we have a v file right here we're going to say template template if i there i am the hello page and since this is view we get to do it everything in a single file and that's it so that's a view component single file view component okay so to get this up and running we need to now run npm and all that good stuff so we're going to go into our webpack.mix and i'm going to say dot view right here and for development purposes i am going to say browser sync inertia.test so we can just have this load up the page and restart the page whenever we make changes that'll make it easy for us all right so now we can finally run this and get to our running application npm install i think is done so we're going to say npm run watch all right error solid um let's see mix command not found let's go and do an npm install i think i may have missed the npm install uh abdul basit a good question for someone who wants to start with vue.js should they start with v2 or v3 um i recommend if you do npm install view it installs vue version 2 so i would recommend going with view two um you can always upgrade to view three and all of your view two code will still work in view three which is cool but view three does give a little bit more stuff that isn't really didn't do the npm install and i think i actually missed the npm install on view thanks jonathan all right so let's double check our package json see what's going on in there down here we have view we have inertia we have inertia view and inertia progress um we have level mix i think that'll be good to run right npm run watch now it's going to say oh you wanted browser sync let me install some dependencies and then it'll uh error out it'll tell us to run it again all right so now we run it again everybody cross your fingers i think this is the one there we go okay so if i load up localhost right here this is our application and if i go to slash hello check this out this is the hello page okay so this is rendered as a view component laravel actually said look this is the hello page i'm gonna send you a view component so one more thing i want to do is let's add a second page and then we can really talk about what inertia is doing for us so here's hello what's another contact.view and i'm going to go over here just copy this whole thing and say contact view right here and contact us okay so we have to hello and contact and i have to go create the route in laravel route get contact i missed a semicolon okay so we have two pages here now if i go to hello and i go to contact we got two pages cool but we really don't get to see the benefits of inertia just yet and i want to show you one more thing that we're doing and this is going to be where the fun happens right so we're going to do a new component right here we're going to say inertia link href is going to be contact go to the contact page an inertial link is something that's built into inertia we get this out of the box and it is basically going to let us link over to the other page i'm going to copy this put it on the contact page and put that right there and go to the hello page okay so let's click over and the cool thing about this which is i don't know if it's hard to tell or not is there is no page refresh if you were doing this um here where's the other page inertia.test and we click this there's a page refresh page refresh page refresh here everything is done with javascript and you get the experience of a single page application so this is really cool because we get the benefits of routing on laravel where if we go look at web.php we have hello and contact and you it looks like a laravel application on the back end right but on the front end you get view uh single page components single file components over here so you have hello and contact and the way that this works if you go to the inertia docs and it says how it works right here let me walk you through it basically inertia is a routing i mean they say it's so much better than i could at its core inertia is essentially a client-side routing library and basically what it does is inertia says oh you want to link over to another page i'm going to make the request with ajax go get the information send it back and then we will re-render the page that you want the information that you want all that good stuff so if i go over here that's the about page i don't want that one we go inspect we go to the network tab xhr right here i can click go to the contact page and notice how it didn't actually refresh the page it made a request to go to the contact page and then the laravel backend on the inertia on the back end said okay check this out i'm going to give you props i'm going to give you a component to go load up and here's the url here's all that good stuff go ahead and render that so that's kind of like the the fun magic trick of inertia is it is going to do all of your requests it'll go to laravel laravel will say look let me give you back the um data and then inertia on the front end says okay well let me route to that specific component so it's really really cool to say look i'm going to get rid of all of the information here as far as api calls all that good stuff so i want to do a little bit more of this and show you more of the benefits this doesn't really show fully the benefits of doing all this i think we'll get to the benefits the next two things we're going to do is get data from laravel into these view components and we can see how that connection works and two we're going to create a form on the front end and see how we can process a form and create like a chat box on the front end so those are the next two things we're going to do to round out this tech talk uh and when it switches between pages inertia dynamically swaps the page components which means vue doesn't have to reboot yes um jonathan awesome lots of good stuff i also saw the work you all did with modals that was fantastic um let's see travis says why not no js really if you want no gs then go for it this is a solution for anybody that likes laravel like myself um and they like vue and javascript on the front end so it's a fantastic stack i think it really all depends on how you and your team work maybe you have javascript developers on the front end and you have php laravel devs on the back end pick your stack for your team right okay so next up let's go over here and we're going to say let's go get all of these messages i'm going to push this right here and how do we get this into our view components well we pass it in normally like we would with a laravel spelled that wrong so notice that the difference between kind of the laravel way and the inertia way is just this what we're rendering right we're rendering with inertia versus we're rendering a view with laravel blade so on the back end very little has to change if you're bringing in inertia on the front end you can have somebody that likes view likes react likes felt do all of their stuff uh and the way that they can get data is check this out you say props and we're gonna say messages is an array now up here we can say let's loop over the messages give um let's go v4 say message index in messages is it in i always forget my syntax on for loops all right so here let's go key is index my for loop could be wrong um and i think this is kind of what travis is saying right like there's a there's a context switching of i'm going from javascript to the php side and already you've seen me kind of mess up my loops um so just be aware of that message.text all right let's go see if this works go to the hello page did something happen i might have broke something before message oh there we go okay so we have our messages coming in from uh laravel into our view component and our view developer sees this as a normal view component our view developer actually has no idea that data is coming from laravel or from a parent component or an api they just know look this component gets messages so that's kind of the awesome part right is we saw the the context switching scenario where i had to go from php to view but if you have a team where you have view developers on the front end you can say look stay in view land i will give you the props that you need and i'll tell you what the props are that you need but don't worry about the back end uh and yes jonathan has a great point here folks that using folks using inertia tend to prefer that since the appeal is working with a monolith and i'm going to touch on that next because that is a very big productivity boost when you don't have to build two repos and an api to connect the two um so this is how you get data into from laravel into a view file let's start talking about how we can send data back and start making that two-way connection right so here let's say we're on this hello page really i should have named it messages but that's okay let's say we wanted to have a form so let's drop this inertial link right here and i'm going to create a form we have tailwind so let's actually make this look good so text 3xl font extra bold jonathan and chad is actually also a co-author of tailwind so a lot to thank him for in this tech talk on extra bull let's go for margin bottom 12 add a message then for these messages let's go for class is going to be background white padding of 8 rounded shadow and that should be decent and then here let's go for class is flex flex column justify center item center background blue 500 okay gigantic because i'm zoomed in um that's okay okay let's see one more thing i know we aren't really wanting to get into styling but i cannot abide it has to look at least decent so let's do that space x of 10 um min height is screen almost sorry just bear with me for like 10 more seconds and we're gonna get this to look good uh this will be text blue at 100 and then this one is space so let's do a margin bottom of maybe all right let me catch up on chat anybody have more questions i see a lot of people in chat um let's see yes it seems like there's a lot of questions on hosting here um muhammadu says laravel embezz vgs by default so why not use view and view routes what does inertia bring us i'm going to get to that point right now because the idea is what if you did not have to write api calls or the backend api so right now we are only in web.php right so let's say we had a um we wanted a chat box to create messages on the front end and then the back end says okay let me save messages and then i will give you back new messages um oops almost here flex space x right there um what did i do wrong oh let's wrap this in a div okay so we have this here we have our chats right here we're going to say add a message and then let's add a text box down here we're going to say form and we're going to say input type actually let's go for text area and then let's say okay so let's do a couple things so we're going to say at is equal to submit and v model is equal to form dot text and then down here well let's add in rows is equal to eight and then down here we're going to have methods and then submit is going to be one of those methods and this is going to where we're going to say um send data to our backend and then we're also going to have data right here and we're gonna say return form is text is blank i think i might have missed closing something yep right here all right hold on oh thanks uh joan for the close on submit i love the chat right now it's it's uh it's super busy i've just got to catch up on it sorry about this all right mr mango laravel storing anything in the database yes we are we are storing a messages um model in the database so here uh something broke let's go i probably am just writing wishful coding um oh i forgot a comma right there okay so here is our chat box right here here are the messages that are being stored in the database and now we're going to create a way to send this data over to our back end uh thanks santosh for the comma so um let's send data to our backend so the question is is what does inertia give us that we can't already do with just laravel and vue.js right so if we built a traditional level application we set it in these view components on the front end we would have to do this to get data to our backend we would have to say fetch um api slash right and this would be method is post body is json.stringify this dot form i think well i think i would do it that then res all that good stuff right so we would have to say okay i'm gonna send data back to an api and now we have to go in to our routes api and we have to go down here and say okay handle creating a new message and this will be route dot post messages function request and then we would validate the request send info back as json so you're essentially building an api right here and then you know if you had a full crud application you would have um get all get a single updates create delete all of that good stuff you would have to build out in an api so now all of that logic moves into your api and all of the logic moves into this into your javascript so you're essentially writing a lot of code to connect the back end and the front end um right on mr mango so let's see how we can do it with inertia without having to write that api layer all that good stuff let's that should be fine to leave i think i don't know um so let's delete that and let's see how we can do this with inertia so inertia has a helper we can say this dot inertia dot post messages and we can say this dot form and that's it on the front end so now we're taking the data and we're sending it to this messages endpoint and over here i can create the messages endpoint we can say route post i'm going to start speeding this up i think we're coming up to the end of this messages function uh request um request like this and then we can say message create best input is it request all then we can return redirect to the hello page i wish i named that messages that's so confusing i'm sorry uh okay so this is how we would do it in kind of if you had a laravel form you would just have the form say route post messages and then you would create and then just redirect back to the original page which is over here and then you would be able to show all of that stuff again right so over here if we had hi there and i press enter uh let's see i broke something um it's probably in my view file submit is here um form is there text area is there let's chew just do a button type of submit add a message and then let's make sure we can actually to hmm oh okay that worked um not entirely sure what that was really so what happened here is we actually submitted a form jonathan i'm not sure what that was but it looks like it's working now kind of terrifying but uh good that we're here so what we're doing here right is we have sent a post request to our laravel route an a level route not a laravel api um and this is the route we sent to and we treat it as if it was a normal http request which means we can do all the cool things like validate yeah i think that was it jonathan um sometimes you just gotta refresh to force it so uh what we can do here also is we can validate things as we normally would with our laravel apps so let's go for like validated is equal to request validate i'm going to say text is required and we're going to say min is 50. and then down here we can say message.create validated so now your javascript developer sorry your php laravel developers you just build as if you've built a application since when laravel was created right you just are building out oh here's a route post i'm going to validate it i'm going to create it and i'm going to redirect back to the other page and then we'll show all the posts again or all the messages again and then down here in view how do we handle errors now we can say well we're going to get an errors prop and it's going to be an object and over here we're going to say if b if errors dot text errors dot text so i'm going to finish this out and then we'll talk about all of the benefits that inertia gives us and a lot of the code and hopefully you're seeing it a lot of the code that we didn't have to write to build out an api and to connect to it from the front end right um so let's see i need to make sure that this is going to fail validation so we're going to go over here min 50 is there let's go over here we're going to say hi there add a message and notice that we didn't do a page refresh and the error came through from the back end and we were able to display it using view and there was no page refresh so if i do right click inspect and i'll refresh the page here let's go to network xhr right here let's clear these out we'll say whoa this is cool that should fail validation since it isn't 50 characters add a message and you get messages right here the text must be at least 50 characters and you see right here so props errors the text must be at least 50 characters so inertia handles just making the connection to the back end sending the props and errors back to your view components and all without a page reload so if i change this back to minimum one and we went over here and refreshed said hi everybody add a message check that out no page refresh it looks like a single page application everything is happening um i hope you like inertia this is really cool and we could do some more stuff where we like empty out the text area when we add a message right but this is kind of the big benefit of the code that we had to write were essentially these two routes your hello route where you just display all right here this is your creation route where you validate create and then redirect and the only thing that changed from original laravel blade to inertia is this was render and now it is inertia how cool is that right and then over here you just got your view component as if you were building out a view component react spell whatever you decide all right so that's about everything i had for you all the ability to create two um laravel routes right and then to set it up so that you have view components on the front end that were able to submit data like this and then inertia just handles the connection between the back in the front end and then just updates your front end application quickly and without a page refresh really really fun stuff uh let's see looks like i left that message up a while sorry about that all right so that brings us up on close to the end of the tech talk i see a lot of questions let me catch up um but while we're here throw out any more questions you have the creator of inertia is in the chat with us so definitely a great great experience to have with jonathan here thank you so much for joining uh yeah but let me let me catch up on dark calf says i can refresh only a section in the page yes there are partial where is it partial reloads so the docs do a fantastic job of saying look i know you're probably thinking this is the next step so let me go ahead and give you the docs on that as far as authentication there is a question on authentication let me paste this for partial reloads there's that um as far as authentication if you go down here to authentication the cool thing about this look how short these docks are is you just handle it as if you were building a laravel application and uh inertia will handle the rest since it's making the request to the back end you can go over here and just use your middleware like off and all that good stuff and uh inertia will handle for you all right any more questions let's keep going gonzalo what stack do you prefer vue and nux or view and inertia um for me i don't personally know nuxt very well so and i know laravel really well so for me eileen view uh inertia and if we're going further i kind of lean react these days which inertia also works with uh right on harold thanks for joining thanks for saying that this was a dense talk because there's a lot of really fun stuff to get through but overall i think the message is fantastic of look build your laravel application um build your front end application and guess what they're going to connect to each other you don't have to build an api you don't have to make api calls you don't have to worry about cores or any of those problems uh you don't have to worry about json web tokens a lot of that stuff is taken care of for us because we're just building out these great laravel modern monolithic applications thanks riley i appreciate you saying that oh ssr is coming soon yeah so that's fantastic uh server side rendering is coming soon so uh the benefit of server side rendering is that your entire page is kind of just uh exported to the user as html then i imagine that inertia can do all of the stuff at the after the fact but the fact that your page is sent to the user as server-side rendered means it's going to be incredibly fast uh since there's no javascript you know work in the client side to render the page and you get the benefits of what you would expect from a laravel application as far as like server side really fast static right on oh matt thanks for saying that appreciate you joining thank you so much uh dark have awesome thank you thank you but yeah what do you all think of inertia it sounds like a lot of people are liking it um i like the progression of the chat is a lot of the chat at the beginning was like you know what why do i need inertia what does it do and then once you see what inertia once you see how much code inertia saves you for myself it's like oh that's fantastic and i think a lot of a lot of the moves moving forward seo uh benefits jonathan absolutely i think one of the benefits um i lost my thought i don't know uh douglas catch us on ssr when it's out absolutely we'll definitely uh there's a lot more stuff we can do in with inertia here i think this is a good getting started with inertia but i think there's a lot to be said about building a real application um maybe we'll take this chat app further and actually build out where is it yep maybe we'll take this chat out further and may maybe we'll build like a slack clone on tech talk that's something i've been wanting to do and i think this is a fantastic setup for it um before i go if you want to chat with me chris uh underscore underscore sev on twitter also please subscribe down below to the digital ocean channel we are doing tech talks every week pretty much um mine are every two weeks and i'm doing a lot on uh laravel i'll be doing a little bit more node work for anybody that wanted the node work uh yes jonathan very good point uh the demo app right here so if you go to inertia's docs down here demo app if you want to see like a full-fledged application this ping crm is a fantastic uh showcase and the cool thing about this is this it's built in view but if you scroll down there's a lot of good third-party contributions for level react svelt mithril which i personally haven't used yet ruby rails if that's your um tool jimmy barrios vim rocks i agree uh let's see well do we know yeah when we build out a larger application we'll definitely handle auth the cool thing is is inertia makes that easy because it is laravel off um yeah so i think that'll wrap it up for us everybody that is a lot of fun thank you so much for joining in the chat jonathan thank you so much for creating all the cool things and joining really appreciate you being here jonathan says i love session off yeah it just makes things easy right if you don't have to deal with laravel's built-in authentication is very very powerful very strong um session based auth and the reason that a couple of these layerville packages have been popping up is because of that api layer right you have like uh what passport you got um what's that f1 fordify all of these api off things that we can get rid of if you're using inertia right on thanks thanks everybody appreciate you all being here uh ficar mr mango um manuel jonathan of course riley jorman eric jimmy thank you everybody for joining i think we'll wrap it up here uh this tech talk will be recorded and on the digitalocean channel if you want to check it out and of course we'll have some more coming up so stay tuned thanks everybody for joining i'll see you next time
Info
Channel: DigitalOcean
Views: 11,256
Rating: 4.9880238 out of 5
Keywords:
Id: XEW2d2XHkAk
Channel Id: undefined
Length: 59min 36sec (3576 seconds)
Published: Tue Apr 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.