2 | How to Easily Install Laravel | Laravel for Complete Beginners | Laravel Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
today I'm going to teach you how to install larwell inside your computer and before we actually get into the video I just want to say a couple of things to you know before we actually get started on installing and setting up everything uh the first thing is that this is a beginner tutorial so I will try to as much as possible to break things down explain exactly what we're doing why do we need this program you know everything that you might need to know as someone who has never dabbled in this sort of thing before so everyone needs to be able to follow this tutorial and hopefully get L well installed now of course people are sitting on different devices out there um you know my computer is set up differently than another person's computer maybe your firewall might block something you know things can change because we don't all have the same computer so I just want to say that at any point during this tutorial if you have any sort of struggles for example maybe you get an error message maybe larell doesn't want to install make sure to take that error message and use a help tool like for example chat GPT to tell it okay so I'm getting this error message how can I fix it and then maybe chat GPT can tell you how to fix that error so it's important to know that you know getting errors is kind of like part of learning something as a you know a programmer or developer so make sure you don't quit if you get an error message that's really my important thing to say here cuz anyone will get error messages it's about whether or not you're capable of solving it so using chat gbt Google things that's just part of being a developer and again hopefully we're not getting any sort of error messages in this tutorial here but I'm just saying it might run into it and it's important you know how to actually solve it if you do actually encounter one so now as we follow this tutorial there's going to be different steps in setting up larwell and I have them all on screen here so you can actually see each step one by one and you may look at this list here and say well okay that looks like a long list like there's like several steps in here to get larell installed but I don't want you to worry too much about it because most of these steps here is a one-time thing so once you've done most of these steps you're done and unless you're planning on getting a new computer or you you know have uninstalled larwell or you know composer or whatever on your computer uh you won't have to do it again okay so it is something that is a one-time thing for most of these steps here there's a small section at the bottom there that you do have to do every single time you start a new website project but again it's not really that much it's more of the onetime setup thing that scares people um people get errors in when they try to set up things on their computer so that's really the struggle that we have to get past but it's not that difficult you just need to to know how to do it right so now getting started with LW well is quite a journey if you've never done anything like this before cuz you're going to learn a lot of new things in this video here it's not going to be difficult but it is new things right so the first thing I want to show is when you use a computer whether that being a Windows machine or a Mac machine or Linux or whatever uh you will have to use something called a terminal in order to do things and this is probably the one step that scares the most people whenever we get started as developers doing things like this uh because a terminal is something that you will need to use and everyone uses it but the first time you see it you might be thinking o okay now this is outside what I'm comfortable with um but I just want you to not worry cuz it's not really that complex it's not really that difficult it's more the mindset of understanding what a terminal is and why it's not scary okay so we need to know what a terminal is so if you're on a Windows machine uh if you go down inside to search bar and type CMD command prompt by the way you can also type in and click enter then you're going to see we get this window here and this is a terminal or at least this is a command prompt on Windows if you're on Mac you're going to have to to search for terminal because that's the name of your software but basically this is a way to interact with our machine and you can do many different things like getting information off of your machine you can change things on your machine you can even install things off the internet using a terminal which by the way we're going to do in this video here so a terminal is very normal for developers to use and it's a really good idea just to sort of get comfortable with it from the start because you are going to have to learn to use a terminal so this is one of those things that some people look at and say oh no this looks like this looks like coding you know like do we have to code things to just like install L well um but it really isn't that difficult it's just more about not getting scared of the terminal at the beginning like that's that's the difficult part so with all that said let's actually go and get started on installing larell so the first thing I want to say is that there's many different ways we can set up larell on our computer we could just install PHP directly onto our computer from php's website uh you can also install a MySQL server and just run that on your computer there's many different ways we can do things okay now the way we're going to do things because this is how I've done it in all my other tutorials in my PHP course is we are going to be using examp which looks like this so you're going to go and install this program onto your computer so you can actually use a server on your computer and it does also have PHP included into it so we don't need to install PHP from php's website so it has a bunch of things included um and I just want to point out here as well that if you already have examp installed make sure you get the latest version otherwise there could be some mismatch between the examp version and whatever larell version we're trying to use so make sure you're getting the latest version of examp I do also want to point out to you that in the latest version of examp there is a small change to how you're going to be accessing your websites inside exm because typically in the older versions We would go inside our exm folder inside our HT Ducks folder and we will put all our websites in here as you can see this has changed a little bit so instead we're going to putting all our websites inside the dashboard folder okay so this is where you want to put your websites just ignore what I have in here for now these are just some private things um but this is where you're going to be opening up your websites and create all your different website folders so what I'm trying to say here is that it's important you reinstall exam to the latest version if you haven't already I do have a tutorial on it so if you click on the link inside my description you can get to a tutorial where I show how to install xamp so if you have any sort of doubts about that check out that video the next thing we're going to do is we're going to go and install something called composer and I know this looks weird okay I'm well aware uh but this is actually what PHP developers use in order to manage all the different dependencies you might be using for all your different PHP projects now just to briefly explain what composer does basically when you have any sort of libraries Frameworks like for example larell and you need to have them installed on your system we need to have them installed into somewhere because whenever you want to create a new website you're not going to have all libraries and Frameworks that you might have installed in your computer inside that project uh so you need to have some sort of container on your computer that can have all the libraries and Frameworks inside of it and then from there you can say okay I'm going to start this new website project which one of these libraries and Frameworks do I want to use inside that project so you can just handpick out which ones you want to use and put inside different projects that you have on your computer okay so we need to have something that can contain all the different libraries and Frameworks so we just use them in whichever project we might want to use them in that is basically what composer is okay so you're going to go ahead and download composer and we will actually install it together I do want to point out here that if you're sitting on Mac this is going to be slightly different okay you want to get inside getting started go into where it says installation for Linux Unix and Mac OS then you want to go down and make sure you follow these steps for installing it globally and again I don't have a Mac so I can't show you how this is done on a Mac machine but if you're sitting on Windows this is a lot easier so all you want to do is go up to the very top here where it says installation for Windows and then you can see we get a composer - setup.exe so if you click that one it is going to download a composer setup and all you have to do is open it up and install it so if we open it here we're going to make sure that we say install for all users which is the recommended one so we click this one and you're going to go and say yes to the popup because there's going to be one once we have the setup started you just want to say next then you want to make sure that this path here is actually pointing to where you have PHP installed So currently because I have xamp installed you can see that the path you is actually pointing into my exent folder into my PHP folder and inside to my php.exe uh execution file so this is the PHP uh installation so to speak inside exam so make sure it has this one selected if not then you're going to have to browse for it it is inside your exam folder in this path that I have here okay so we click next and then it's going to set up composer and then we're just going to say next and then we want to say install and that is basically it and it will give you a couple of important notices here you might need to close down all the different Explorer windows that you have so for example the uh you know this one here you need to close these down uh you want to make sure that maybe that you actually restart your computer because it can run into some errors if you don't do so uh so it has a couple of different steps here if something were to happen which doesn't need to happen so if at some point inside this video here might get an error message try restarting your computer and see if that helps basically that is what composer is trying to say okay so we're going to say next and then we're going to say finish and that means we now have composer installed so once we did all of this we need to do one more thing before we're really you know ready to start installing larell and all that kind of thing uh which is a step that can seem a little bit frightening to some people uh basically you're going to be adding composer and PHP into your path inside your system and this is something that some people may not have done before okay uh the basic explanation to what we're about to do is that if I were to go inside my command prompt and I want to gain access to composer in order to do something so let's say I want to ask composer to install lwell into a certain website project then I need to write a command for composer inside the terminal but in order to make this process easier since I don't want to like go into the composer's installation path and before I can actually start writing commands for composer setting a path for composer basically means that I have a global access to composer so I can just go directly in and just write commands for composer directly okay so that is something that we might want to do because otherwise it's going to get quite frustrating and annoying every single time you want to do something with composer and PHP um so let's go ahead and go into our uh explore so what you want to do is you want to make sure that you right click on this PC go down to properties and then inside here you're going to go into your system settings and on the side here it says Advanced system settings there's a small link over here once you click that it's going to open a small window down here at the bottom you can see we have something called environment variables again this is on PC there's also a way to do this on Mac and I will have a small link in the description that will tell you how to do this on a Mac okay so on a PC we're going to go inside environment variables go in here and at the bottom it is going to say system variables we want to be setting PHP and also composer as our system variable so we have a link to where these are so we can just directly use them so going down inside new you can see that we need two things we need a variable name and a variable value so for example if I were to go inside where I have PHP installed so I'm just going to go inside my HD docs folder which is inside examp I'm going to go back and then you can see we have a PHP folder if I go in here and scroll down a little bit you can see we have a php.exe file this is the one that we want to link to so go ahead and copy the path go inside to where it says variable value paste it in make sure you have back slash php.exe because we need to get the executable path so do that and then create a variable name this could be PHP and then say okay and then that will be added as a uh new system variable now I've done this already so I'm just going to cancel and the next thing we're going to do is we're going to go and set composer as our system variable now this one is slightly different you can actually see I already have it in here as well uh this one you're going to find by going inside your this PC go inside local disk go inside where we have program data now if you don't see this folder it's because it's hidden so you need to go inside view at the top here and make sure that hidden item items are ticked on okay otherwise you can't see this folder so go down inside this folder then you can see we have composers set up click this one go inside bin and then copy this path here you don't need to include the composer dobat or anything like that just this path up here so make sure you copy it go inside and create a new system variable say this one is called something like composer and then paste in the value which is the path into where this place is okay and then you're going to say okay now I've done this already so I'm just going to cancel but this is basically how you can set these up so they can be accessed globally inside your computer so what we can do now is we can actually verify if we do actually have composer installed in our system by going inside our Command Prompt or your terminal and type in a small command just to check which version of composer and PHP we have installed in our computer currently now you do need to close down your command prompt and restart it because otherwise you might not get anything going on so we do need to restart it and then you're going to write composer space-- version click enter and then you can see we have composer version blah blah blah and PHP version blah blah blah right so this actually confirms that we have these installed and if you don't get these it means that you skip something or you forgot to do something that we did previously maybe didn't set up a system variable make sure you did everything this video and you should be getting this again also try restarting your computer if you're not getting it because that is also something that could be causing it but what we can do now is we can actually go and install larwell into composer so we can then grab larwell from composer and use inside any sort of new website project that we might want to be creating right so that is what composer does we download larell into composer and it just kind of hangs on to it until we need to use it inside a website so what you're going to do is you're to type in a command called composer space Global space require space larell for SL installer which is actually going to download the installer of the internet and install it inside composer so if I click enter here you can see that it's going to start installing things and it's just going to run its course it's going to do a bunch of things um so as you can see it's installing we're getting lar well everything is working and just kind of let it do its thing here and then at the end here it should be successfully installed so with lar well now installed because this is what we need to do now larell is installed in our system or at least inside composer is that now we can actually go and start using lell inside our projects however we do need to do one more thing before we start doing things with larell otherwise you might encounter some error messages which is we need to set up examp to properly work together with larell so go ahead and open up your examp installation plate and go inside your PHP folder scroll down until you find the php.ini file which is going to be down here right below the php.exe file open this up inside your text editor because we're going to be changing a couple of things in here so inside my text editor if I click control F or command F and Mac then I can actually search for things so it says find and then I can go ahead and say that I want to search for extension equal to zp and then you can see I have a extension here called zp and you want to make sure this one is uncommented so if you see a semicolon in front of it go ahead and remove it so it's uncommented okay the next thing you want to uncomment is one called file info so search for file info and as you can see it's right here this is actually a re-uploaded tutorial because in my last version I did actually say to uncommon two other things I want you to make sure that you double check if you're getting any sort of errors while you're installing a new LEL project uh because in the last video we did get a SSL Error I want you to uncomment one other thing which is actually the one that is right down here which is called extension equal to mysqli uh make sure this one is uncommented as well but do not uncomment the one called SSL actually it's called open SSL so do not uncomment this one because you may receive an error message while you're trying to install all L well because this one will actually have two extensions of the same kind open at the same time and may throw an error message so just go and close down the php.ini file and what you're going to do is you're going to go and go up to where it says terminal and open up a new terminal now the reason we can use a terminal inside our code editor is because we set up composer and PHP inside our system variables so because we did that we can actually start using them directly inside the terminal inside our text editor which is really nice because we don't have to go inside our Command prop Dage a single time we can just close this down we don't need this anymore and instead we're just going to use this terminal in here and you may notice something inside the terminal which is the right now we have a path set to C drive users the name of your user uh so this is not really a path inside a specific project or inside a specific folder so what I'm going to do here is I'm going to navigate inside my dashboard folder which is inside my XM installation so I'm just going to say file open folder then I'm going to go inside xamp make sure I go inside my HD do folder inside my dashboard folder and then from here I'm just going to say select folder and again I do have some files in here just go and ignore those for now because you're not going to have these files your dashboard folders should be completely empty unless you have some websites in there but just go and open this one up go back inside terminal say new terminal and then you can see now it points to A New Path which is the XM folder HD docs dashboard and the reason you want to make sure we're inside this path here is because we're going to set up a new project which is based on larwell inside this path here so basically we're creating a new website inside our dashboard folder so what we're going to go and do here is we're going to say lar well because now we have it installed in our system so we can actually refer to it we're going to say space new and then in name of your new project in my case I'm going to say first website then I'm going to click enter and as you can see I do actually get an error message here and that's again because we need to restart the software just like composer told us so I'm going to go and restart my software here so after restarting vs code make sure you go back inside your dashboard folder and inside the terminal you can actually go up and down on your keyboard and see all the previous commands that we tried to run inside the terminal so you can click up and then you can see we have larwell new first website now what we're going to do here is we're going to go ahead and start creating a new project so I'm going to click enter and then it's going to run the installation or setup process for setting up a new larwell project now some people have told me that they're not getting this setup process and it just starts installing larell for the first time that's fine uh but what we can actually do here is we can set up a couple of different settings for our installation of larwell now in the first one here it ask would you like to install a starter kit for now we're just going to go and say none because we do not want to have one at least here in the beginning of this tutorial here if you want to later on experiment with let's say jet stream you can do that for now let's just go and leave it at default so we're just going to say none the next thing is going to ask us is which testing framework do you prefer in this case you can choose between Pest and PHP units in this case here pest is the more newer and modern version that we can use so we're just going to go and say pest so we're going to say zero enter and after it's done doing all of this it's it's going to ask you if you want to migrate or at least as you can see here which database application you want to use for your website now on this case here we're going to be using MySQL but we do need to set up a database first otherwise it's going to give you some errors because there's no database to migrate database tables into so we do need to make sure that we have a database set up already before we start doing anything here with telling it what kind of database you want to be using uh I do want to point out that if you do type MySQL from here and oh you clicked enter nothing is going to go wrong because you can still afterwards set up your database it is just going to Reas you once you open up the website oh there's no tables inside your database do you want to migrate the tables in there and then you're just going to say run migration and then it's going to do it so nothing is going to go horribly wrong if you start typing something here it's not really going to be a big deal uh but let's go and open up our examp control panel and actually start up our Apache and MySQL server and after doing this we can go back inside our browser and we're going to go ahead and open up a new tab and we're going to say Local Host slash PHP my admin and once you have PHP my admin open you're going to go inside databases at the top here and inside databases you're going to go and create a new database called first website so first website and then click create now I do already have a first website created in here because I did like I said recreate this tutorial so you already have one and after creating it you can actually see the database on the side here so you can click it and then you can see we have nothing going on inside the table so going back inside vs code I'm going to say that we have a mySQL database click enter and then it asks do you want to migrate the database default migrations I'm going to go and say yes and doing that it's going to set up the different tables inside your database so going back inside PHP my admin refreshing you can now see that we have a bunch of tables in here so we have like a users table we have sessions you know different things that are incorporated into larell because users like creating a login system is built into larwell so this is something that they creates for us at the very beginning so with all this set up now we can go back inside our project and we have now actually set up lwell inside our computer and set up a new lwell project so go inside the first website over here on the side and you can see that we have a bunch of files because these are your lwell default files that it installs for you when you set up a new project now don't get overwhelmed because yes seeing this many folders and files is something that do overwhelm people from time to time um but we're going to go and take this one step at a time as we progress in these tutorials here so just go ahead and know for now that you don't need to know everything that is going on inside every file inside this project here so you don't need to get overwhelmed over the fact that there's so many files in here I do want to show you one more thing before we end off the video which is our website because we do have a website now so with XM running so make sure you have the Apache server and the MySQL server running we can actually go back inside our browser go inside the tab at the top here say Local Host then you can see we get all the different folders inside our Local Host folder or inside the dashboard folder and you will notice again I have some files that you don't have just ignore those for now but go inside your first website folder and in here you're going to notice all these different files that we have inside vs code like these are the same files what you want to do is you want to go inside the public folder and in here we have our website I think I have mine zoomed in here I'm just going to zoom out for you so this is your freshly installed larwell project okay these are just some default placeholders ERS that L well installed inside your front page so we don't need to use these we can always remove these if you want to um but this is your front page to your new website so this is how we can set up larell in a fairly easy way inside our computer and again I just want to point out here for the beginners that whenever you want to create a new lwell project you don't need to do everything in this tutorial here you just need to go back inside vs code go inside your dashboard folder and from in here you just want to make sure that you run the if you go inside the terminal here you just want to run the larell new and then new project name and then run the installation process again and then that's it like that's how you create a new larwell website and now before we end off the video here if you got a error at some point when you try to set up your database or something like that and you're still getting error messages instead of seeing this you might be seeing error messages basically uh what you can also do is you can go inside your project go down to the bottom here where you have a .v file open this one up and inside of here you can see we have a couple of different settings for our larwell project like these are environment settings so a couple of things you'll notice is that we do actually have things like app name we have things like app URL you have things like if you go down to the database connection you know is it a mySQL database yes it is uh what database Port are you using what is the name of your database what is the username for your database what is the password like like there's a couple of things in here that you need to make sure are in order because like you know the password for your database is pretty important if this is incorrect so if you're getting some error messages you can find things in here and you can change them to for example if you change the database name and it's not first website maybe you call it first website too then you can just change it here um so a couple of things you can do here to set up your website so with that said in the next video I'm going to show you around inside our project a little bit there's a couple of things I need to show you where is for example where's your front page at so we do need to look at a couple of things inside this project just so you have a faint idea about where some of the things might be at so with that said I hope you enjoyed this video and I'll see you guys next time [Music] up
Info
Channel: Dani Krossing
Views: 13,007
Rating: undefined out of 5
Keywords: laravel tutorial, laravel tutorial for beginners, laravel course, learn laravel, learn laravel for beginners, php framework laravel, laravel php framework tutorial, php framework tutorial for beginners, laravel, laravel php, Laravel for Complete Beginners, laravel for beginners, how to install laravel on windows, how to install laravel xampp, install laravel with xampp, easily install laravel, install laravel for beginners, how to easily install laravel
Id: iBaM5LYgyPk
Channel Id: undefined
Length: 28min 6sec (1686 seconds)
Published: Sun Apr 28 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.