‫Okay.
‫So now we're going to get our files onto the server.
‫And there's a few ways to do this.
‫You can use git if you come down here to advanced and go to git you can add some SSH keys and you can
‫add your repository.
‫However we're not going to do it like this because our structure is going to be slightly different in
‫production.
‫Because just because of the way the server is set up, we have a public HTML folder instead of a public
‫folder.
‫We also need to change up the paths a little bit.
‫So Hostinger has an incredible file manager.
‫It's the fastest file manager that I've ever worked with.
‫It's just drag and drop and it's literally like you're just moving it to a file on a folder on your
‫computer.
‫So if we go to files and then file manager and then access files of whatever your domain is, it's going
‫to open this.
‫Okay.
‫Now my domain is hooked up at the moment.
‫If I reload you'll see it does give me a 403 because there's nothing in here.
‫This public HTML, this is where the the files that you want to be public go.
‫And you guys, if you're following along you probably have a hosting or a landing page.
‫I deleted it.
‫So now I just have a 403.
‫But the domain is hooked up.
‫Okay.
‫Now the way we want to do this is everything that's in our public folder for our application needs to
‫go in this public HTML.
‫We don't want the rest of our stuff like framework app, the controllers, that stuff.
‫We don't want that in the public side of our website.
‫So that's going to go somewhere else.
‫So let's go ahead and just open up our local project.
‫Let me see.
‫I'm going to go to.
‫Right here to projects and work.
‫Opia.
‫All right, so what we want to do is take everything that's in public.
‫Now, there is a dot access file in here that is hidden.
‫You can't see it in my file manager.
‫You want to make sure that you bring that over as well.
‫So let's grab these.
‫Put those into public HTML.
‫And you'll see just how fast this is.
‫So that's it.
‫They're now uploaded and I'm going to just since I can't see the dot to access file on in my file manager,
‫I'm going to just create a new file.
‫So right here new file.
‫And I'm going to call it.
‫Dot h t axis.
‫Make sure you have the dot create and now it just opens the file.
‫So now I'm going to grab what I have in my h axis which is this.
‫And just paste that in and then click the save button.
‫All right.
‫So now we have that file there.
‫And it's grayed out because it's a hidden file.
‫Now that takes care of the the public.
‫Now let's go to home and notice there's a file here that says do not upload here.
‫So you don't want to upload to the root.
‫So what we're going to do is create a new folder on the same level as public HTML, but not inside public
‫HTML.
‫And I'm going to call it source.
‫You could call it whatever I'm going to call it src okay.
‫Now this source folder, this is where the rest of our code is going to go.
‫So I'm going to grab everything here except for public because we don't need that I mean technically
‫you don't need some of this stuff like read me or license.
‫We do want the vendor folder because that's where our auto loader is.
‫And remember we're not using git.
‫So none of this stuff is going to be public.
‫So even our config our database file we can just bring that right over.
‫So all of this drag it over.
‫Takes a couple of seconds and there it is.
‫And if you guys have been around for a while and you've used some of the older file managers from like
‫cPanel, those things were brutal to work with.
‫This is just fantastic that you can just drag over a bunch of files and folders, and it's really like
‫it's right on your machine.
‫All right, so now let's go to our domain and let's see what happens.
‫So if I reload I get this page isn't working.
‫Now this doesn't tell me very much.
‫So what I'm going to do is I'm going to enable error checking or error display.
‫So let's go to the entry point which is going to be public HTML and then index.php.
‫And at the very top here above everything else I'm going to say any underscore set.
‫And in here I'm going to set the display.
‫So display underscore errors.
‫And then I'm going to pass in a second argument of one.
‫So I'm enabling display errors.
‫And then we want to set error.
‫Error underscore reporting.
‫And we're going to pass in here.
‫E underscore all.
‫So it's going to just tell us all errors.
‫So let's save that.
‫You can either do command or control S or hit the little disk icon and go over here and reload.
‫And it's going to be instant which is also great.
‫There's no waiting.
‫Whatever file you edit you save and it's just you reload and it takes effect.
‫So now we can actually see some errors here.
‫So this one here require and it's trying to require the vendor auto load.
‫So our auto loader and it doesn't know where it is because remember it's not in our route anymore.
‫The vendor folder is not in the route.
‫It's in the source folder okay.
‫So what we have to do is in the index.php where we're requiring our auto loader, it goes up one level.
‫But instead of the route let's say src slash vendor.
‫And then we want to do the same for the helpers file.
‫Because that's also not in the route anymore.
‫It's in the source folder.
‫So right here we're going to say src slash helpers.
‫So let's go ahead and save that.
‫Let's go back reload.
‫And now we get a different error.
‫And this is about our database.
‫So remember we have our config right.
‫So if we go back to the source and we go into config I just put an underscore db here.
‫This is just for public.
‫So basically my GitHub repo has that.
‫You can just ignore it.
‫But our DB PHP is what is being looked at.
‫And this no longer works right.
‫Because this is our this is our local credentials.
‫So if we go back to the panel here and we go to database, where is it.
‫Files, databases and go to management.
‫So this is the database we're using.
‫So we want to make sure we grab this and put that as our database.
‫Right.
‫And then our user whatever you have here is going to be your user.
‫So we want to put that.
‫And then whatever password you used when you created it, which for me was I believe.
‫123DEF123.
‫Okay, I believe that's the correct password.
‫So now I'm going to save that.
‫And I'm going to go back to my domain and reload.
‫Actually did I save it.
‫And there we go.
‫So now it works.
‫Work opiate tech now goes to my home page.
‫And if I go to, let's say the details page, that works.
‫Now if you go to the login page and you get something that says something about the middleware directory,
‫that's because it's looking for.
‫Let me see here.
‫It's looking for a middleware folder with an uppercase M.
‫So in the framework right here, if your middleware folder has a lowercase just go ahead and just right
‫click rename it and add an uppercase M there because that's what it's looking for.
‫And then the login and register pages should work.
‫All right.
‫So let's test this out.
‫We'll create a new user.
‫Let's say I don't know Harry and we'll say Harry at gmail city say Miami Florida.
‫Tab one two, three four, five six and register.
‫Okay so now it registered that user and logged us in.
‫So now I should be able to post a job.
‫And I'm just going to put some junk in here.
‫Because we'll delete it after anyway.
‫All right.
‫So now email test at test.
‫Save.
‫Okay, so you can see that our sessions are flash messages are working.
‫There's our new listing.
‫If I click on it, I can see the edit link.
‫And if I delete, I can delete it as well.
‫So everything seems to be working and that's it.
‫We're now deployed so super easy and we're just doing it on regular shared hosting.
‫And I can't say enough good things about hosting or I've worked with them for a long time and they just
‫offer so much for such a little price, such a low cost.
‫And again, you can get even more off 10% off with the code Traversy media.
‫So that's it.
‫In the next video, we'll just do a quick wrap up.