‫All right guys.
‫So now it's time to start our project.
‫And I said this in the course intro.
‫But I want to reiterate it again what I really want to focus on and what I want you guys to focus on
‫is the underlying framework of this application.
‫And I don't mean an existing open source framework like Laravel or Symphony.
‫I mean the core of our application, our custom framework that we're building.
‫You know, we're not really focusing on the design or front end or UI all that much.
‫This is not a react course or something like that.
‫We're doing a lot of back end stuff, so it may not seem like a lot of functionality when you're just
‫looking at the front end of the website, but where the work is in this project is building the infrastructure
‫or the framework for this project to sit on.
‫So that's why I plan on releasing a Laravel course where we build the same project using the same whatever
‫HTML, CSS.
‫But we can add a lot more features because Laravel gives us that existing framework.
‫Here we're creating that framework ourselves.
‫All right.
‫But with that said, I do want to just go over and show you the, the website, the different pages
‫and functionality, etcetera.
‫Also, I wanted to show you that I do have a repo here.
‫It's private at the moment, but it will be public when the course is released.
‫And this has all the code.
‫It also has basically all the setup if you want to get going, shows you how to change your document
‫root things that we're going to be doing running composer install for the auto loader.
‫So all that stuff is included in the GitHub repo, and I'll have a link somewhere in the course to this,
‫but it's basically just my name Brad Travis slash workshop dash PHP.
‫So as far as the layout goes, the design, it's pretty simple.
‫I just created it with tailwind CSS.
‫You guys will get all the theme files and all the HTML, because you will have to copy some of the HTML
‫and put it into into partials and so on.
‫Basically everything's going to be in a partial the nav bar, the search, the banners, job listings,
‫etcetera.
‫And you'll be able to pass data into those partials and into the main views.
‫So the nav bar just has a login and register.
‫So we have a login register with name email.
‫I did put city and state just in case you want to add a feature where you map the user to certain jobs
‫in their area, things like that.
‫And then password confirm password.
‫We have some validation going on.
‫Let's see.
‫So on the home page we have the latest six jobs six jobs listings.
‫And if you want to see more you can just click on Show All Jobs.
‫That takes you to the main listing page.
‫There is a post a job button here.
‫If I click that, it just takes me to login because you do have to be logged in to post a job.
‫And once I log in, which I'll do right now.
‫It'll have one of those buttons in the header as well.
‫Okay, so now you see I have the welcome message here.
‫Log out link.
‫And then the posted job.
‫Now before I go to the posted job page, I just want to show you if I click on details, that takes
‫me to a page that shows me a little more information about the position.
‫So the title, description, salary, the location which is the city and state tags, job requirements,
‫benefits.
‫And then there's an Apply Now button.
‫And if I click that it's going to just open up your default email client and put whatever the company
‫email is into the to field.
‫And then if we want to post a job, we can click on this button here or the one down below.
‫And it takes us to this form here.
‫And I'm just going to pause the video.
‫Enter some data here so you don't have to watch me type it all out.
‫Okay.
‫So we have some data filled in.
‫So now I'm going to go ahead and click save.
‫And I get a flash message.
‫So basically we're going to have a message stored in a temporary session variable so that it can show
‫a message.
‫And once it's displayed then it's cleared from the session.
‫So now I have this job here.
‫It's our latest job.
‫If I click details now I have an edit and delete.
‫So any listing that I own that the user ID that's logged in owns is going to see an edit and delete.
‫And obviously if I don't own that listing then I'm not going to see those buttons.
‫So if I click edit it'll just take me to the form with the information.
‫Here you can see I'll be able to edit it.
‫So if I just put a one there and save it says listing updated and my title has changed.
‫If I want to delete, I'll click the delete link.
‫And now it's gone and you can see listing deleted successfully.
‫So that's pretty much the gist of it.
‫And it's very simple as far as functionality.
‫But like I said, what we're really focusing on is the the core of the application and creating the
‫custom router.
‫Being able to pass in params like an ID, being able to pass in middleware to protect certain pages.
‫For instance, if I go to slash auth slash register, it redirects me because it knows that I'm logged
‫in and there's no sense in showing a register page.
‫Okay.
‫And if we I mean I can show you the code real quick.
‫So for instance, if we look at let's look at routes dot PHP.
‫So this is how we'll be creating our routes.
‫We'll have the methods.
‫So get post put delete and then whatever the URL is.
‫And then that's going to be connected to a specific controller class and a specific method.
‫So if you if you've used Laravel before then you know this looks very similar to how Laravel works as
‫far as the router.
‫And then we can pass in middleware such as auth or guest if they can, if they are logged in and you
‫want to block them from seeing log in or register or whatever.
‫And then as far as the router go, you can see we have a framework folder with with all the core of
‫our project here.
‫And if we look at the router we have these these get post methods here.
‫And then each one is calling this register route with whatever the method is the Uri the action.
‫And then any middleware that's put in there which is then put into an array.
‫We come down here to the main route method.
‫And this is where basically all the magic happens.
‫So it checks the method.
‫It loops through the routes, it matches, sees if there's any params like an ID, and if there is then
‫it uses those down here.
‫So if there's a match and it's the correct route then it's going to authorize the it's going to use
‫the authorize middleware.
‫And then it's going to load the correct controller and the correct method okay.
‫It's going to instantiate that controller here.
‫And all the controllers are in the app folder.
‫This is where all the controllers and views are.
‫So that's that's kind of the gist of it.
‫I'm not going to give too much away here.
‫And everything is going to be very incremental.
‫Like we're going to start with a very, very simple router that just matches a URL to a file, a PHP
‫file.
‫It doesn't take into account Http methods or classes or methods or anything like that.
‫So we'll start very, very simple and just work our way up and I'll explain everything as we go along.
‫All right.
‫So that's it.
‫Let's go ahead and get into it.