Laravel First Impressions From A JavaScript Dev

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I've been a web developer for 15 years and in that time I've built with a lot of different Technologies but I've never really given PHP a try and today we're going to fix that today I'm going to build an app with laravel and you're going to see my first impressions the one thing I've noticed when I see laravel people in my Twitter timeline they all just seem to be happy they avoid all the drama and JavaScript land that we seem to drum up each week and they just seem content to ship good code and build their applications I want a piece of that I want to know what it's all about so as a developer who builds a whole lot of next.js apps a whole lot of node.js I've npm installed my weight in packages I'm going to give you my first impressions of PHP in a blairville [Music] so here it is laravel.com the PHP framework for web Artisans I like that I like to think of myself as an artisan sounds way better than web developer what do you do I'm a web Artisan like the handcraft my web applications laravel is a web application framework with expressive elegant syntax we've already laid the foundation freeing you to create without sweating the Small Things uh let's get started all right why laravel there are a variety of tools and Frameworks available to you when building a web application however we believe laravel is the best choice for building modern full stack web applications I build a lot of those full stack that's I would call myself a full stack developer it's a shame really that I'm just now ending up on laravel.com we like to call laravel a progressive framework by that we mean that laravel grows with you if you're just taking the first steps into web development laravel's vast library of documentation guides and video tutorials will help you learn the ropes without becoming overwhelmed if you're a senior developer I like to think I'm a little senior laravel gives you robust tools for dependency injection unit testing cues real-time events and more laravel's fine tune for building professional web applications and ready to handle Enterprise workload I will say that's the draw for something like laravel or rails or Django it's like an all-in-one it's got it all for you you want to do email you don't need to go pick an email thing you just like it's in the framework you want to do cues which is pretty common Believe It or Not uh they're built in how do you do cues on xjs riddle me this that's right you use an external service you sign up for whatever SAS they recommend in the docs incredibly scalable thanks to the scaling friendly nature of PHP and laravel's built-in support for fast distributed cache systems like redis horizontal scaling with laravel is a breeze in fact liberal applications have been easily scaled to handle hundreds of millions of requests per month hundreds of millions that's a lot that's a lot of requests need extreme scaling platforms like laravel Vapor allow you to run your laravel application at nearly Limitless scale on aws's latest serverless technology all right your first laravel project before creating your first layerable project you should ensure that your local machine has PHP and composer installed if you're developing on Mac OS PHP and composer can be install via Homebrew in addition we recommend installing node and npm alright uh if you install PHP composer so we need to do this manually I guess see here composer uh can I just do Brew install PHP composer oh boy it's Brew which means we're about to update everything on my system here we go auto update oh boy 90 of outdated formula and six outdated casks feels good so composer is their dependency management thing okay so we can globally install laravel and then just laravel new The laravel's Artisan CLI serve command Okay larval and Docker no thanks uh composer let's do the global thing uh okay seems to be working and now we can go CD example app PHP artisan serve we've got an app an example app cool what's next if you like a head start When developing application consider using one of our starter kits I might give this up to speed a little faster uh larval Breeze huh a minimal simple simple implementation of all of laravel's authentication features including login registration password reset email verification and password confirmation in addition Breeze includes a simple profile page where the user May update their name email address and password this sounds amazing level Breeze's default view layers made up of simple blade template style detail NCS CSS or Breeze can scaffold your application using view or react and inertia okay now let's stop this and let's do this uh okay huh require laravel jet stream okay execute jet stream install Artisan command this command accepts the stack of the name of the stack you prefer Livewire or inertia uh and you can do teams I'm not gonna do that so PHP PHP artisan jet stream install Livewire we're not going to do teams I don't know what they mean by teams support like if your application needs to have like multi-tenant teams and then teams can add users to it or something maybe we're not doing that we're going simple it's getting getting into it you are highly encouraged to read through the entire documentation of Livewire inertia before beginning your jet stream project we're not going to we're not going to do that new applications only jet stream should only be installed into new layer of applications attempting install gesture stream in an existing layer of application will result in unexpected behavior and issues okay uh we did it uh installed with ssro i1 SSR well maybe not because inertia I'm not doing that I'm doing Live Wire okay dark mode uh should have included dark mode kind of is it too late to do it again can I do it again see what it does hey it might work hey I don't know if it worked but it didn't complain npm install can't you can't escape it JavaScript just can't get away everywhere you go your npm doing stuff bummer uh let's migrate our database I didn't ever set up a database I guess I probably should yeah I think this is the part where I have to okay so if I just do this and then I need to edit I need to edit the uh dot ends uh what am I doing DB connection SQL Lite SQL ite sqlite okay how about that is that gonna work once you've configured your sqlite database you may run your application's database migrations okay let's try that okay we have a database now PHP artisan serve is that just gonna work so now it's got jet stream look at this we got register and login name um sure okay we have a dashboard this is actually really great I'm pretty excited we have a profile page look at this I love it two-factor auth like this is pretty awesome so I think things like this exist in the JavaScript ecosystem they're just so fragmented like everything in the JavaScript ecosystem is fragmented and most of the people running the show don't know what they're doing whereas laravel is all like one guy and he drives a Lambo Taylor just makes all this stuff so there's a consistency about it all the product offerings sort of work together highly desirable so I can change my password I could update my email just like everything works this is amazing are you kidding me two-factor off huh look at this look at this this is incredible a permanently delete your account thing man I wish I would have used this to rebuild stat Muse I could have not had to build this whole page I just did this on status it's so much worse than this one and this is just built in so then the dashboard I guess there's like let's look at the app let's actually look at the code um so config bootstrap I literally know nothing about PHP or laravel so routes so API routes auth sanctum get user this is where you can register API routes for your application these routes are loaded by the route service provider and all of them will be assigned to the API middleware Group make something great so encouraging make something great channels app models user.id okay what is this one console is where you may Define all your closure based console commands each closure is bound to a command instance allowing a simple approach to interacting with each command's i o methods uh oh okay inspire this Comet inspiring quote hmm okay here's where you can register this is these These are these famous uh Taylor comments right where they're all like perfectly like staggered downward just that's some attention to detail right there resources so we got some JavaScript in here what's all this Alpine I've heard of alpine.js I've heard of this uh okay axios part of me there's like this fear of using JavaScript outside of one of the big Meta Meta Frameworks like writing JavaScript that's not an xjs app just feels so like scary they've made it so scary like at this point you feel like you're not capable you're just not smart enough to do all the things you need to do to run JavaScript in the browser I just it's probably not true it's probably a lot simpler than we realized there's just a lot of fear some CSS okay Tailwind Imports we got some public uh that's our database what are all these config files so going back to it on the one hand it's like wow that's a lot of files that's just a lot of files that I'm just a brand new code base and I'm starting with a lot of files on the other hand it's a lot of functionality like this app is already like doing stuff and most of the starter apps in JavaScript land do absolutely nothing they're just like a single page with like a logo that spins in the middle and and like look if you make a change in the file it's automatically updated on the page hot module reloading look how cool but like it doesn't do anything you know what I mean uh so a template like this like this jet stream concept that already has multi-factor like two-factor auth it has delete the account and it has log out of other browser sessions all of this stuff that's common to all apps the fact that it already has all that that goes a long way so I understand it's just different approaches like if I wanted something like this and JavaScript land I'd have to pay money it's just some template you'd buy on somebody's I don't know somebody's personal side they sell welcome to your there it is it's a blade template and this is familiar this is just it's h HTML right just HTML with some Tailwind classes I look at this stuff all day long so that's good I know how to work with this but how does it interact with the other stuff so X application logo let's just search for it X application is it this no application mark oh application load okay so the X means something X is prefix on all of these things so if we look at application logo oh it's just an SVG it's just literally an SVG and that's where we're importing it right here cool okay um so because I just need to see that like it reloads or something I do need to see that does it reload oh maybe it doesn't not that that's the only thing that matters it's just like the instinct when I create something new in JavaScript land I change the file and I save it and I watch it update it's just like what I'm used to uh so then if I go back and save it okay so not not live reload that's fine I mean it's fine I just didn't know ah okay so then dashboard let's find this dashboard navigation menu okay uh oh that's an interesting syntax what is that app layout so what is this file dashboard.blade uh what is this doing is that a client-side thing possibly uh that dashboard uh what is that or no oh that's just the word dashboard is it flash board is that just that word right there yeah right is it that whole thing yeah okay uh let's see dashboard navigation menu so here we have uh has team features oh teams that was that now I just I'm so curious now how much functionality is built into the teams one so we're gonna redo this whole thing and I'm gonna install with the teams option first I gotta do a new app and we'll call this one composer create project laravel teams 2. CD teams two okay let's do the uh dot in um sqlite okay and and what else do I need to do uh oh I need to do touch that npm uh let's do the composer require laravel jet stream okay and then PHP artisan something with yeah jet stream install okay I think we're doing it I think we're doing it right this time now let's do npm install and npm run build and now PHP Artisan migrate okay PHP Artisan serve okay so we have to log in I want to register huh oh here we go Adam's team oh wow this is incredible team settings add a team member oh my word this is amazing what did I say create new team I create multiple teams team two what happens here okay so if you need wow this is incredible so much functionality uh so team settings we've got there we got email address where I can add a new so atom plus test m1. I can add him as an administrator oh connection could not establish the host oh male pit so I'd have to actually set up an email thing okay seems reasonable so I need to set up email which I have not done uh let's just go back here process pending team invitations okay so much stuff that's built in and now if I go to my profile do anything else is it all the same probably it's all the same this is so impressive though just to have all this user stuff built in and now you're like Off to the Races you've got a dashboard you can start hacking away on uh yeah this is super compelling I will say like a lot I would need to do to get up to speed with being productive in a PHP application where I'm writing like controllers and Views and all this stuff in a PHP application but super compelling uh let's see what else I want to look at HTTP controllers what is that yeah there's just a lot of boilerplate that I don't understand uh but in time I'm sure I would my first impressions it's all very cohesive you got like one leader calling the shots and building out everything you'll ever need two you've got those two different tracks for front end development I'm a little confused as to how inertia works because it's like bringing in all the modern Frameworks like Nexus and next and so I've got to understand better how what that whole picture looks like I think though from what I'm gathering it's just build your back in with laravel and with PHP and then you're doing all your front end stuff it's just like avoiding you're not doing node.js backend stuff it's not JavaScript on the server it's PHP on the server but then you get your front end it's like your modern JavaScript Stacks I'm not sure what inertia does in that equation I guess it's just the packaging of all of that uh but Livewire is something different and it's basically re-running and re run like rebuilding your template based on activity in the case we saw an input as the input changed presumably it's making yeah xhr requests or Ajax requests and bringing back some new HTML and updating the Dom uh so it's different different approach it's mostly more native laravel it sounds like you're you're still just building like laravel PHP templates blade templates more observations incredibly well documented and meticulously the the famous comments you know the perfectly like aesthetically pleasing comments three lines that whole thing the whole like myth it's true I saw it all over the place not that it was a myth but just that like people talk about it even outside the laravel community so clearly a lot of attention to detail was put into every piece of this product offering it made me actually want to build like a side project like laravel makes me want to build some kind of like B2B SAS that has teams especially because I feel like you'd save so much time having not built out all those features for inviting new team members and all that stuff it makes me want to build something just anything really I'm super intrigued this will not be my last experience with laravel uh I would say very pleasantly surprised with a lot of the ecosystem being just very nice to work with uh now obviously I didn't get in and write a lot of code I didn't write any code did I write a single line of PHP no I wrote no code uh this video was literally just me installing the app poking around seeing how the files are laid out kind of what's created for you uh getting a little bit up to speed on some of the verbiage in laravel land so things like jet stream and live wire and inertia JS uh it's not entirely clear to me that all of those are first party I'm not sure if any of those are actually third party but they're just well documented uh but that's all the kind of stuff I can pick up as I go along I'm intrigued I'm gonna build something there's no way I'm not going to build an app now after seeing how good the starter project is uh with laravel Jetstream I'm definitely going to build something and I'm going to try deploying it with laravel Vapor maybe that'll be another video if you'd like to see another video where I poke around more with laravel maybe deploy it uh just let me know in the comments this was fun [Music]
Info
Channel: adamdotdev
Views: 50,237
Rating: undefined out of 5
Keywords:
Id: Spwv0RbITmE
Channel Id: undefined
Length: 21min 7sec (1267 seconds)
Published: Mon May 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.