Array ( [status] => 1 [transcript] => hey there gang and welcome to your very first lell [Music] tutorial all right then gang so in this series we're going to learn how to use LEL from the ground up to create a small website and along the way you're going to learn all the fundamental LEL Concepts and building blocks like routing making views models handling data migrations and all that jazz but first of all for those not familiar with laravel what exactly is it well laravel is a popular modern PHP framework for creating web applications and it comes with a bunch of setup and features that make it really easy to flesh those applications out when it comes to things like routing creating data models authentication making views Etc it's got a really active community and ecosystem around it so you're never far from help when you need and on top of that I think laravel's a nice choice if you're struggling with JavaScript fatigue which hits us all every now and then but if you do want to keep of your JavaScript framework for the front end then laravel works great with those two so in this series we'll be making a simple crud application which looks something like this and by the way crud stands for create read update and Destroy doesn't mean it's crap but anyway this is a directory of ninjas which all get listed here on the homepage and you can click any one of those to see more information about them we can delete ninjas from The Details page which also shows a little success message whenever we do back on the homepage and you can add new ninjas by going to the create page and filling out the web form so along the way we're going to be learning about routes like I said views something called blade which is a templating engine we'll be learning how to hook the application up to a database what migrations are web forms and something called eloquent models as well which make it really easy to manage and communicate with your data plus we'll be covering a bunch of other really useful stuff as well it's going to be really extensive the course and I won't be assuming any prior LL knowledge or experience however since this is a PHP framework I would expect you to already be at least a little bit familiar with PHP the language so if you're not then I'd recommend checking out my PHP course before you go any further and I'll leave the link to that course down below the video anyway now we've got a rough idea of what laravel is and what we're going to be building let's go ahead and make a brand new laravel project now historically if you wanted to make some kind of web application using PHP and a SQL database you'd have to manually everything up on your computer like PHP itself uh MySQL a web server like Apache or engine X Etc and you can normally install those using a tool like zamp or mamp you'd also have to install something called composer which is a dependency manager for PHP now once all of that was sorted you could eventually spin up a new lelt application and start coding so if you wanted to you could go down that route and everything would normally work out fine however a much easier alternative is to use a tool called her which sets up the entire PHP environment for us in a single click and that means we can get larl projects up and running really quickly without any kind of configuration on our part on top of that it automatically handles things like multiple PHP and nodejs versions on your computer so to download it head to herd. ll.com and you should see a download button right here for whatever operating system you're on so click that and just download it and walk through the installation steps okay so once you've installed and open her it should look something like this you've got a dashboard where you can stop and start the server I'm going to start it by clicking on this button right here so that later on we can view the project in a browser you can also change the version of PHP you're using right here and you can open up all of your current LL sites by clicking on this button and that's going to list them all out in this new window with information about each one all right so let's close that and next up we've got some general settings right here where you can do things like configure your startup options and your default IDE mine is set to vs code at the top you're also going to notice this herd paths section along with a single path pointing to a her folder somewhere on your computer so this herd path is basically a directory where herd sets up an isolated environment to create lar Val projects in and it contains all the configuration and binaries that we need to do that in this isolated environment so whenever we make a new Lara project we'll be making it inside this herd folder so just make a note of where that is for now all right so below that we've got the PHP tab which shows the different installed PHP versions and it's going to let you know when there's an update available to those versions as well you can see I've currently got version 8.3 installed on my computer you've got a similar thing for node versions in the next tab as well and by the way you will need nodejs installed on your computer computer to fully follow along with this course because we'll be using it later to install some frontend dependencies so you can do that by clicking one of these buttons right here to install a self-contained version of node for use within larl project inside the her directory we just saw if you wanted to or if you've got it uh globally installed on your computer that's fine as well anyway I don't think we really need to go through the rest of these tabs so just make sure on the dashboard you've clicked the button to start all services so that server is running and then we can go ahead and make a new LL project inside that her directory okay so now open up your terminal of choice I'm using Windows terminal which you can download from the Microsoft store if you want and you need to navigate to that herd directory inside the terminal that we saw before because that's where herd sets up the isolated environment to create and run new PHP and more specifically new larl projects so I'm going to CD into that directory and now we can use the LL command with within this environment to create a new LL project to do that we can type laravel new and then the name of the project which I'm going to say is ninjor network but you can call this what you want but anyway if you press enter lell is now going to walk us through the process of setting this application up and it's just going to ask us a few questions along the way and the first question is would you like to install a starter kit well no we don't need a starter kit and a starter kit is basically just a load of code that comes along for the when we create a new project to get started with certain things but again we're going to go with a default option which is up here no starter kit so you can just press enter and it says which testing framework do you prefer well we'll just go with Pest and then down here would you like to initialize a g repository no we don't need to do that all right and then next up it says which database will your application use we're going to go with the default option which is SQL light so just press enter again and then it says would you like to run the default database migrations now we're going to learn about migrations later on for now just press enter on the default option which is yes and that creates us some Basics St tables okay so now that's all installed we're going to see this URL right here where we can view the new LEL project in a browser so whenever we make a new LEL application inside the herd folder it automatically serves up your application to a local domain like this which is nice so remember or copy this URL because we're going to be viewing it in a browser later on all right so now we want to CD into this new project directory so let's do that first of all and then we can open this up in vs code by typing code then a space then a full stop and then just press enter all right then so let me just zoom in a little bit first of all over here just so we can see everything a bit clearer and the first thing we need to do is install all the front end dependencies so if you go down to the package.json file you can see we've got all these things right here these packages that we need to install so we need to open up a terminal to do this make sure you're in the correct directory and we can type npm install and press enter and this is the reason we needed node installed because we're going to use npm which comes along for the ride with a node installation all right then so now I just want to give you a very quick explanation of some of these files and folders because there's a hell of a lot of them and if you're new to Lal then it's probably going to be a little bit overwhelming but actually when you break it down I promise it's not as complicated as it might seem right now so I'm just going to go over the parts that we'll be primarily be working with throughout this series and that starts with this app folder so the app folder is where most of your application Core Business logic goes so things like data models and controllers and we'll learn exactly what those are later on in the series the database folder is where we make migration files which are like instructions I guess about how to structure database tables we also make things called factories and seeders in this folder which both help us populate the database with dummy data for testing the application with the resources folder is primarily for any uncompiled front end code like JavaScript and CSS we also make any views inside this folder which are typically blade templates that get rendered on the server but then gets sent to the browser as HTML pages and blade by the way is just a templating engine that we can use with lell to inject kind of dynamic code and data into a view so whenever we're making any templates or pages that we want to show to the US in the browser we do that inside this views folder and you can see right now we already have a view called welcome. blade. PHP and inside that is what looks like an HTML template all right so next up the routes directory is where we register all of the routes for the application and decide how to respond to requests to those routes for example if we had a page on the website where the route was SL contct in the address Press Bar then we need to register that route and handle request to it inside this folder so right now you can see we've got a single route set up inside the web rout file which is where you're going to Define all of your website routes and this route is set up to respond to get requests in the browser to this path right here which is forward slth base route of the domain and it responds to requests to that path by returning a view called Welcome which is the welcome uh view that we just saw a moment ago okay so this means when we visit this path in the browser after the domain then we're going to get sent back that rendered welcome View and we'll talk more about routes and Views in probably the next lesson but anyway these folders which I've just walked through are where you're going to be spending about 99% of your time during this course as we make and flesh out a larl application and we'll be diving into each of these directories and talking much more about them as we go forward this was just more of a little gentle overview of where the different moving parts of the application Live all right then and finally down here we've got a few configuration and package files as well which we might dip into at some point later in the course so again I know it looks like there's a lot going on here but honestly as you start working with LEL you're going to come to realize that it's not actually that complex right then so there's one more thing I want to do before we preview this application in the browser and that is to go to the welcome View and just make some quick changes because right now it's a long ass file full of unnecessary code so we're going to keep it simple and we're going to strip it right back so I'm actually just going to copy this line right here this HTML tag because it has this Dynamic blade syntax right here which outputs the language dynamically for us dependent on our app settings so I'm going to copy this in fact I'll cut it and then I'll get rid of all of the rest and then I'm going to boy plate a new HTML document essentially by typing Doc and then then tab and I can do that because I've got the blade package installed over here first of all which is Lara blade so make sure you install that first of all and then once you've done that if you go to settings over here and then search for Emit then down here you need to add an item call the item blade and set the item to HTML so now we can use those HTML emit features inside blade files like this okay anyway I'm going to save this and then I'll replace this HTML tag right here with the one we just copied all right then so inside here we can say ninja Network for the title and then we'll just flesh out a very quick body I'm going to do an H1 that says welcome to the ninja Network and then below that I'm going to do a paragraph tag and it will say click the button below to view the list of ninas all right and then we'll finally do an anchor tag right here with a class of buttons so a. BTN and the href doesn't need a value right now but for the text we will just say find ninjas like so the reason I've added this class is because later on I will be adding some CSS to style this a little bit so that's just me adding it now so I don't have to do it later okay then so now if you visit ninjor network. test in the browser you can see the applications automatically being served up at this domain and we can see that welcome view content on the page right here so if you called your application something different then you just need to update the address bar to reflect that but it should be your application name. test and this is something her configures and serves up automatically for us we didn't need to do a thing which is nice although you do need to make sure that you're running those services within the herd application itself otherwise this won't work all right then so now we've used heard to install everything that we need to make laral apps we've made a new laral app we've had a quick tour of the project structure and we've now previewed that in the browser as well so in the next lesson we're going to talk about routes and Views in much more detail just one more thing before we finish this lesson though and that is that I've created all of the course files for each lesson and I've uploaded all of those to this repo right here which is called laravel 11 for beginners so I will leave this link down below the video and each lesson has its own branch on this repo so to see the code for a specific lesson you can just select that lesson from the branch dropdown right here if you wanted to browse the code you can do if you want to download the code then you can do so by clicking this button right here and then downloading a zip folder by the way if you want early access to the course so you can watch the entire thing now you can grab it on the net ninja. deev website it's just $2 to buy the whole thing so I'm going to leave the link to this course page down below the video for you or if you want instant access to this course plus the entire net ninja course Library including all the masterclass and pro exclusive courses you can sign up for a net Ninja Pro subscription it's just $9 a month and you can get your first month half price using this promo code right here so I'm going to leave this link below the video as well anyway really hope you enjoy the course and I'll see you all in the very next lesson )