How To Deploy Laravel 8 Project | Deploy Laravel Through FileZilla | Laravel 8 Project Hosting

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up guys my name is dari and i hope that you have a great day a couple days ago i did a poll on my instagram asking if i should create a video and how to deploy a larval website on a server and the responses were great and now we're here me creating a video for you guys on how to deploy a laravel project if you want to have more influence on the videos that i make or the series go follow me on instagram because i do a lot of polls and you can easily send me a dm on things that you need as you can see on my screen right now we have our website where we have a login system and we have a blog but as you could see everything is deleted right here because i want to transfer this database from my localhost to my web server honestly there are a lot of different hosting websites where you can buy a domain i'm not going to tell you which one is good or bad usually my go to is domain.com and i have it open right here so it's domain.com but you could also use other companies such as godaddy or bluehost i will add an affiliate link in the description down below so if you do need one go through my link so i can earn a little bit from it too whether you are using bluehost godaddy or domain.com you need to use your cpanel to deploy your laravel project you need to use your cpanel or ftp credentials to deploy your larva project it can also be done through git but since i haven't used git on my youtube i want to do it through ftp so i have already bought a domain to save us time you could go to the description down below in order to buy a domain and if you already have one let's log in because what we need to do is to get our ftp credentials so let me log in if you're using domain.com you need to click on hosting in the top navigation and on the left panel you can see something called ftp management so let's click on it you can either create a new account or use the account that we have right here you can edit the user and you can change your password so let me actually set the password all right let's edit the user whether you're using your cpanel inside your domain or filezilla the idea behind it is exactly the same now make sure that your account is enabled and like i said whenever you want to deploy your website you need to use ftp which stands for file transfer protocol and it's basically connecting two computers together so what we need to do is to open a new tab and go to google.com search for filezilla and most of you guys already have it because you use it to upload html websites as well now let's open the first link so filezilla dashproject.org and right here you need to download it and i already have it installed so pause the video and i'll see you back in a second all right let me go to a new screen let's open filezilla and as you can see we need to add some credentials right here the host is ftp dot followed by the domain name so let's say codewithdariforme.com now we can grab the username fromdomain.com so let's go back the username is this one right here let's paste it in right here now the password is the password that i just created for the port it is either 21 if you use ftp but if you use sftp which is an encrypted version of ftp you need to use 22 or 2 2 2 2 but since i'm using ftp i'm using 21. let's quick connect so let's click on ok and as you could see it has been connected on the right panel you can see a couple files and folders in here but the one that we need is the public underscore html one but before i continue on i want to set up our database first so let's go back to the browser and as you can see right in the left panel you can see a mysql management so let's open it let's add a new mysql database let's call it laravel block click on next create a username let's say code with dory password is all created and don't enter data right here that you don't remember because we need to add these credentials inside our emv file all right let's save it we don't need to set the privileges to something else because we actually don't need it these are the basic tasks that we need to do so let's save it and as you can see right here we can manage our database so let's do that we have our database credentials right here and as you can see we could go to phpmyadmin for a database user so let's click on it now the next step is to save our local database that we have and import it right here with this button right here if you can't do that or you don't have your database anywhere you could basically create your name you could basically create your new database now if you use your local phpmyadmin you could easily click on export and import it right here but what i have done throughout the course was using cli so i went to mysql dump it through the cli as well let's go to the terminal let me open a new tab now what we need to do is to cd into our desktop and in here we need to create a mysql dom so we're basically going to export our database so let's say mysql dump space dash databases space then we need to set the user so dash dash user is equal to root space you could also set the password right here but the best way to do it is to just write down password and to not set it equal to a value and what this will do is basically ask you for a password after you have performed this command then we need to say which database we want to dump so in my case it's laravel block then we need to say greater than followed with the name of our sql file so let's say laravel block dot sql hit enter and like i just said this will ask for a password and be aware that this isn't the login password of your computer or laptop it's basically your my sequel password so let's say for me dory one two three four hit enter now if you go to her desktop let me close off filezilla you can see a new file right here called larval block right now we're ready to import it so let's go to chrome let's click on import well we first need to click on larval block so the database click on import choose the file and let's go to desktop and open the laravel.sql let's click on go now our database has been imported with 61 queries and as you can see we have our tables failed underscore jobs migrations password resets posts and users what we need to do next is to go to filezilla so let me open it again and let me actually make it bigger so what we need to do is to find our laravel project first so mine is stored on users dory a file called desktop right here obviously i have a workspace and in here i have laravel 8 complete blog so let's open it open laravel blog whenever you're uploading a basic html website you usually will upload it right into the public underscore html that we have right here now that's not something you want to do when using a laravel application this is mainly because everything inside the public underscore html folder will be visible for all visitors and that's not what we want right you don't want to give users or hackers access to your emv file for instance so on the right panel which is our chat server we need to create a new folder so a new directory called larval block let's go inside laravel block and obviously it's empty what we need to do next is to select everything from the left panel so control a but we don't need the public folder so let's command or control and click on public to unselect it now you might wonder why we're not uploading the public folder well we have no sensitive data inside the public folder so we want to upload everything else right there so users have no access to it and then we want to upload everything inside the public directory into the public underscore html directory and before we do that be aware that this might take 15 to 30 minutes depending on the size of your application and your internet speed so what we need to do is to right click and click on upload and i will pause the video and i will be back when it has been uploaded successfully now that it's done we need to place the files from our public folder that we have right here inside the public underscore html so let's select everything inside the public folder let's click on upload and this won't take long because it's not a lot of files all right this has been done successfully so let's go to the browser let's change the url to code with dari.com and as you could see we're getting an internal server error and that's because we need to change a couple of things inside two files now let's go back to filezilla the first thing is the file that we have on our screen right now which is index.php so you could either download it and open it with a code editor or you could easily say view and edit which will open it well let me make the screen well we'll open it in a new tab one second all right right here let me zoom in whenever we register the autoloader right here so register the autoloader you can see that this file is going back one directory and then tries to find the vendor directory and then it will call the autoload.php now this file does exist but the path is a little bit different right since we placed our vendor directory inside laravel block so what we need to do is to go right before vendor write down larval block forward slash so it's going to the root directory find the folder larval block vendor and then it's looking for a file called autoload.php and we need to do the same thing for the run the application as well so right here variable app is requiring bootstrap slash app.php but it needs to be larval block forward slash bootstrap now let's save it let's close it off let's go back to filezilla and it's asking well are the files changed let's say yes and are we done well no because we need to go to our emv file obviously so let's go back one directory open laravel blog and let's edit the emv file as well so let me open it make it bigger let me zoom in in our.emv file now inside the emv file we're using environment variables or we created environment variables that are being used all over our application and even our database connection right here needs to be changed so first the app url which is https colon forward slash forward slash www.codewithdari.com now for our database connection the connection is mysql the host is not localhost anymore and well let me actually show you how you could get your credentials on domain.com right here you have your database name server name and the username so let's edit that our database host is info50083.domain.commysql.com the port is alright the database name is laravel and i will change my username and password and i will blur it out let's go back to filezilla let's click on yes let's go back to the browser and let's refresh our host depending on your connection this might take a while so let's refresh the browser as you can see everything has been uploaded to the server now what's next well let's test our database let's register let's create an account so code with dari info let's add a password let's register all right this works and as you could see a user has been added so our database connection works as well this was it for this video i showed you how you could easily upload a website for filezilla this isn't something i recommend to do because i usually clone a github repo right into my server which is way easier but for beginners i think that this is the way to go thanks for watching this video if you do enjoy my content and you want to see more leave this video a thumbs up and if you're new to this channel please hit the subscribe button
Info
Channel: Code With Dary
Views: 14,726
Rating: undefined out of 5
Keywords:
Id: dG55U27oSb4
Channel Id: undefined
Length: 14min 5sec (845 seconds)
Published: Tue Mar 02 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.