 Hello, this is Christian. So this is video two or part two of the Laravel tutorial. Now, we are going to create a Laravel project. I'm going to install the project inside a folder called Laravel. So I'll make sure you go there and just create anywhere in your drive. And I'm going to go and go to my command terminal and run visual studio code, okay? So code space dot hit enter and that will load the visual studio code. If you're using PHP Store, you would take PHP Store and then do the same thing. All right, so here we are. I'm going to go to the terminal and load my terminal here. As you can see, there's nothing here yet. Now, if you do not have Composer installed, if you type Composer and if you don't see anything, then you need to install Composer first. As you can see, I do have Composer already installed. So once you take Composer hit enter, you can see all these information coming up in here, okay? So these are just all the functions you can use with Composer. Again, Composer is a package manager for PHP frameworks. It's not only used for Laravel, of course, other frameworks as well. So synonymous to the NPM or the yarn that matter. Okay, so you can see that I'm using version 2.3.8 as of today. And if you just want to see the version, you just type in dash, dash version or the capital dash V here, we'll give you that as well, okay? So that is the first thing you need to do. Now, the next thing is you're going to create a project and we use the Composer beautiful for us. So you're going to type in Composer and the command is create dash project space followed by the Laravel slash Laravel. And the name of the project is going to be whatever it is. I'll use here, hello, up with hello Laravel. That's the name of the project folder, okay? So usually you follow this convention, all lowercase is highly recommended and hit enter. And it might take a while depending on the speed of your system because it's actually, you know, installing downloading files as we go. So it might take about half a minute or so depends. And I'm going to just let it run here. I'll pause it and I'll come back when it's time. Maybe about, again, it shouldn't be that long, okay? And we like have a minute or about a minute or so. So let me pause it. Okay, here we go, we're done. So again, it's about a minute or a little bit less than that. As you can see, it installed about 72 packages. I'm including any of the dependencies and so forth here. We're not ready to go. And now you have a folder called hello dash Laravel. And now from here on, we need to navigate inside this folder here. If you expand this folder, you'll see a bunch of files here, okay? If you have been working with other frameworks in the past like Eclipse, I mean Express or Angular React, you should see something similar as you will see that a lot more files than other frameworks maybe besides the .NET. So I'm going to go into that directory. So CD, space, type, hello, or just hv, tab and enter. Okay, I'm now inside here. You can see all these, the files here. Now, once we're inside this project, you can access the artisan library or the function right here, as you can see in this command here. This artisan here, if you type in like maybe artist on list, not that one, just PHP artist, I guess. It would list a bunch of functions or command that you can use. You can see to build, clear your views here. Up here you'll see some more important ones, the queues. We're not going to do that here. A lot of make functions here, migrate. This is really useful for when you create databases. Maybe we'll do that in a future video. But up here you have some of the things or components you can create using the make function, okay? So you make controller, create component here, create some events, some exceptions, handling, some additional middleware, you migrate your database and so forth, you create your model. So a lot of things are pre-built into the framework. So it would do this very quickly for you as opposed to having you write all these, manually yourself, okay? So that is what this is for. And one of the key functions you can see here is called the serve function. So these are like a higher level commands that you can access directly through the artist on library here. So we're gonna run the application by using the serve function here. And also these, the up and down, you see one down here, one up here. These are also very useful for, you know, putting your application into maintenance mode. So when I say you have a live site that's coming on or something and you don't want to, you know, run your site, you put that to maintenance mode by issue this comment down and learn about what is play a message saying that it's currently in maintenance. So that other use don't access it. Until you're ready to go, then you can issue the up command to bring it back up again, okay? They're always around it to be actually get behind, get past this maintenance modes you can still work into, but we're not gonna do that, okay? So let's go ahead and run a code. As you can see, it's full-fledged application is running already, ready to go. And you just have to type the command PHP artist on and serve. Oops, I typed incorrectly. No, I'm gonna get out of that. Sorry about that. Let's try again. There we go. Okay, so it's gonna run on this port right here. I'm going to just copy this and run on the browser because it's gonna launch my browser in a different location. I don't want that. So I'm gonna launch and discuss account here. So here we go. If you see this, then congratulations. You have run or created a level project. Now this is version nine. So the output will be different from the previous version. They have a little bit different in the layout here, but that's not so important. What's important is that this is actually functioning. So right now we are at the root directory. Again, I'm using 127. You can totally change this to just localhost if you prefer that way. It doesn't matter, which is fine. So I'm gonna keep it. That's okay. And this is the slash, which is already included in the first route. If you try to go somewhere else like ABC, you're gonna see the errors is not found because we have not created any routes yet. So let's go back into the program and explore around Laravel. So I'm gonna keep this running. So once you run it, you can keep this running as it is, you don't have to close it. So that you can always just go back to the browser and refresh it. And you can open a new table here. So you can do your code in here. So I'm gonna go back into that app again. So if I need to install some of the stuff, I can run separately here, all right? So let me collapse this down here, make it smaller and close it completely. And let's look at what we have here. So this is the folder you have here. These are the actual folders created by default. I showed you in the previous video. As you can see here, the app is really important. And instead of app you have about five, six folders, five folders here are generated by default in here. And let me close this first. So in here as well at the root level, you have some additional files seen as well. So you see one right here is a composer.json file. This is synonymous to the package.json file and the node environment. It's exactly the same idea. It's just a metadata file that lists some of the really important information about your project. So here you see the name of my project, what type it is, the description. These are provided by default already. If you wanna change it, you can change it here, okay? The required here means that these are the dependencies that you need, you must have in order to run Laravel. As you can see, it recommends version eight, right? The required dash dev, these are only used for direct development. Because we are doing development, you can add more stuff in here if you want. But again, these are the default dependencies. As you add more and more packages, it will be added into this development. And if you do need them to export out to the final project, then you add them to the required part here for the distribution, okay? So just some stuff here, autolo just means that you autolo your data and other libraries in here. And so a lot of stuff in here, okay? So I recommend do not make any changes here unless you know what you're doing, otherwise you will crash your program. The other one is a package JSON here, similar, similar, right? As opposed to the application and the composite itself. Another you see here is the VIT config.js, it's called VIT, I think it's French. It's a, what do you call? It's like a webpack type of program that actually is responsible for scaffolding your application. I believe it's a newer one, but it's quite fast, okay? So let it all use the VIT as far as view. So these are just things that over here. The environment.env file here is a list of some global environment key value pairs that you can change over right if you'd want to. These are also being used in the app folder in other places as well. If you want to access them or include them in your code, you can add them directly in here and then access them. So you see here the name of your application, the environment is now set to local. This is just some base keys make your app unique. Debug is true and the URL is local host that you can see here, okay? And database is set default to MySQL. If you use a different database system, you want to come here and modify these and change these here. So again, maybe we'll do that in a later system, okay? So this was just the environment here. It's also being pulled from this environment, that example as another one can look similar, but I think it used the example here to generate this actual environment file. So if you want to change this to your code, change inside the environment, not the example here, right? Now, so when you look inside here, the folders that we'll be focusing most of the time on are the app folder, the public folder, resources and routes. Until we do databases, we're not going to go in here, config here is usually only, when you config your file, we're not going to be here. The bootstrap here is not what you think what bootstrap is. This is not the bootstrap library for CSS, okay? Bootstrap means it just means it bootstrap the application or your files or your views and things like that to the browser. So that's what it means. So when you run the application for the first time, you go into, as you can see, if you go to the routes folder here, okay? You will see, again, four files. This could be different from previous version or newer version, but version nine has this. In the previous version, I think it was not called a web. This is the web route or the API. I think the older version is called routes.php. So if you're coming from a Flask background or Django, this would be like the routes.py, right? Give you all the routes or the patterns to your website. So in our example here, by default, it gives you one route and using the get protocol to receive a get request. And as you can see, it has the forward slash as a route directory and it's going to launch a function. This is the callback function or so known as a closure and in this context here, that will return a view to the browser. The view function here returns a view name. This view here is a string of a blade syntax or blade view. Now this welcome here is found inside the resources folder. And there is a views folder and there is welcome.blade.php. So notice when we include the view name, we do not include the full name. We're not even the .blade.php, just the first name of that file or I guess all the way to the .blade, okay? And blade will know it. If you want to run the entire PHP file, you can type it here, but I think that defeats the purpose. So the view name, and then after that here, if you want to pass some data, you can pass in a parameter using the array key value pair. Okay, we'll do that a little bit later. Other ways to do it too, not just this, not just one way. Okay, so it will load that view and if you go to the view welcome blade, if you open the file, you're going to see that it looks like this. Okay, so if I collapse, all of these you're going to see it's just a regular HTML, right? From top to bottom, it's a complete HTML5 version here. You see some blade syntax here, the color braces here. This is blade syntax, also known as mustache tags, right? And what happens inside the braces here is actually an expression. Expression is anything you type, a function that returns some data or some, you know, mathematical operations or a string or variable interpolation or anything like that, okay? Here, you see some, you know, just some CSS here, styles, this is inline style, I mean embedded style here. And then down here in the body of your document, you see, again, more blade syntax. The symbol here is denote that it's a blade syntax, it's a if function, if and else, you can see here, right? It was structured very similar to a regular PHP if and else, okay? The only difference I should say is because, is replacing the ensemble with the, you know, PHP syntax. So you see that here, so down here, this is the logo, I think as another one here and the rest of just some other links you see here. Okay, so up here in the head section, which I don't see a lot of thing here going on, but okay, so if you want to, you know, load styles or load images or things like that. Now, this is a view, which is, you can treat this like a front end as well. And it behaves very nicely in PHP and Laravel. You don't have to do any special things like you would probably do with like Express, right? So if you want to link to a image, you would load your images from the public directory, okay? So you'll see that over here, it's the public folder. Let me open that. And this public folder here has an index.php as well and has a fab icon and so forth. So if you want to add like your own CSS or your JavaScript on the front end, you must place it inside the public directory. If you want to link to a logo or a file or CSS image, then what if you type here will look automatically inside the public directory, okay? So for example, I'm just saying, if I have a folder called CSS like that, right? Inside my CSS, I have my own main.css, okay? If you want to link that to your blade, right? You will go up here and you would do like link and the href is you just go directly to the CSS folder and then make that CSS like that, okay? So this is already in the directory of your public folder. So think of this like the public HTML of your server, right? That's what it means, how you access them. So you're not going to go out there to a lot of O and back in here or something, okay? Just go to that, we'll take you right there and maybe again, we'll revisit this later in the future. Now inside the resources, you see there's another CSS and another JavaScript. So these are not the same as you put in the public. It's only available in the backend to use, right? So there's a distinction between the two. So that is the view you saw on the browser. Now what happens when you run the application is that it will go into the app folder here, okay? The app folder is really important. It will intercept inside the HTTP directory. There's an HTTP, there's a console. We're not going to do console here. We do the HTTP, we use everything in the browser, okay? Your HTTP protocol goes here. Inside here you have controllers you'll see here and then there's some models and of course you have your views and this controller, right? So MM view is your view MVC, okay? So one of the controllers and that's the separate your files. And so when the app runs, it goes in here to your app folder, it goes into your HTTP. Inside here and the providers here, you have a route provider here, goes in here, look for your route, right? Inside the web here and it goes to web page, right? Finds that the process is actually pretty straightforward. I don't remember exactly how it goes but it loads in here and it will then launch the index inside your public file. This index here, okay? It will go in here as well and then load your files in here, boost strategy application. It builds the fetch the view and then returns the view and then sends it to the browser and it terminates the view. So it does this every time. We load a new page, it's gonna come in here, right? And look at the pattern, go through a route, find a pattern, once you find it, launch the view, whatever the view is, and then returns it and then sends that view to the browser and then it terminates that request, okay? This is the whole cycle here. Okay, so that is again, very high level. As you start coding, you'll get used to it a little bit better but most of your time will be spent inside this web file creating routes inside the views folder, creating templates and do other stuff in here as well. Like API, we'll do that later. But yeah, I just wanna give you an overview of what it looks like inside here. So we have the controllers in here, we'll do this later. The ring simple controller have, we'll look at the route service file here. We're not gonna touch this unless you wanna create your own groups of routes. We have only two here, the API and the web. And our example will be focusing mainly on the web for now until later, maybe we'll do the API. Okay, so that is pretty much it. And then in the next video, we're gonna go ahead and create more routes and templates and render some data to the view.