PHP Laravel Tutorial for Beginners 2- Laravel Installation and Environment Setup


hey what's going on guys welcome back to this blog and for today's blog we're going to talk all about the environment setup and laravel solution so this is the second part of our laravel tutorial series so first thing first we need this tools so we're going to install wampserver for our server so this will provide us with PHP the Apache server and the MySQL installation another tool that we're going to need is the composer so accordingly it is a dependency manager for PHP so if you don't have already the composer in your installation or in your environment in your local machine so you can go ahead and install the composer to your local environment or local machine so I'm gonna be putting the link in the description so that you'll be able to follow along or you don't be able to install the composer and as well as the web server so again if you're using another or other platform such as mac linux environment so you can see use other version of the web server I think they have the alum and deem mom so you can use that as well so for this tutorial we're going to use web server the composer right and we also have the kit so you can download this as well and install in your local machine so we're going to use these stones later on and also if you want you can also download and install the add-on code editor but penny I do any editor will do but for this particular tutorial series we're going to use the atom that IO or atom editor code editor so it is available for Windows so you can go ahead and install this also so once you have downloaded and install this software's or tools you're ready to install and setup your environment and also install the laravel for your projects alright our next step is to create our laravel project and in order for us to do that we need bash or get but actually we can use the windows powershell for that first on us the composer is integrated to that particular command line or command prompt or the windows powershell so let's open up our windows powershell there you go and i'm just going to change the font here so that you can see what i am typing here so instead of 12 let's make it like 24 hey I think that's better and great you were here at this directory users and an admin so we want to change this directory and go to our localhost directory so CD that that and another one so if you try to check our director we have here the one 64 so make sure you have installed already your warm server so I have here the one and also the directory for our server which is Joe the triple W so now let's create our here by typing the command composer and then great project and then our keyword larval / larval and the name of our application or the name of our directory so say for example if you have a project learning management system so you might want to name your project as LMS like that or in our case because this is for programming knowledge so this is programming knowledge project something like that and then enter press enter and then we will just wait for a few seconds or minutes and allow the installation to finish so I'm just going to pause the blog and there we have it after a few minutes or a few seconds we already have operated our laravel project and then we try to check this project in our code editor which is the atom but like I've said you can use other code editor that you prefer so some of you I think prefer is sublime and me personally I prefer the atom code editor so let's go ahead and try to check this project in our code editor so here we are at our code editor and let's try to open up the project our very own larval project so let's go to file an open folder and let's try to find the peak a project or programming project and then select folder so this is how the project looks like in our file system and if you try to check if we try to open up this in our browser so let's check this let's just close this and let's try to go to localhost and then DK project so as you can see we can see the structure of the directory of our project which is the peak a project that we have created by using the composer so this is a security issue because we can see the how of the project is structured but we don't want that we want to see the home page of our application so if you try to type in public poconos PT project / public so this is the page that we want to see this is the home page of our currently created project a lot of them in order for us to configure this project properly we need to add a virtual host and if we try later on if you tried to browse to our project we shouldn't see this file structure right here so this is some something like RS somewhat ugly for us to see the file structure here so let's go to localhost by typing in localhost and then here you can see the configuration of our one server there you can see and under tools we have here an option to add a virtual host there you go and we just need to add the name of our virtual hosts also for example project ek project that location or that LOC and then probably we need to type in as well the complete absolute path of our virtual host folder so it just literally means that we need to provide the complete path of our project folder so 64 and triple w slash the name of our project which is the PK project programming knowledge project and slash public folder so it means that whenever we have or whenever we browse our project by typing in PK project that LOC it should redirect us to the public folder where in which we can see the home page of our application so there's an option here at the bottom to add a court or listen port but this option or this field is optional for now so let's try to start and create the virtual host here so the files have been modified and virtual host pick a project that LLC was created so we need to refresh our or we need to restart our server or warm server or the Apache itself so you can go ahead and try to restart here to start all services so that the virtual host that we have created will be added to the server or the WAMP server so after a few seconds we can go to the browser and try to browse our virtual host which is PK project that LOC there you go and where is a wiki project equip right Jack so there's an option here that did you mean to go to peek a project that LOC yes of course and there you go you can see our project pick a project that that LOC and redirected the homepage of our project and this is what we see so instead of this ugly fine structure of our project so we can see here the server of our project and in the next blog we're going to talk all about the basic routing and controllers so if you want to learn about this laravel series try to check the next blog which is the basic routing and controllers thanks 
 

Post a Comment

Previous Post Next Post

Recent in Technology News