 Hi, this is Christian. So in this video, we'll talk about Laravel. Now, do any coding here, just going over what Laravel is and how we use it in the program. So Laravel, as you can see, is a back-end open-source PHP, I should say, full-stack web application framework that uses PHP as the source language. It embraces what uses the MVC, the Model View Controller, architecture pattern. You'll see that when we start coding. It has a lot of built-in application features, things I list here, as you can see, and many more. But these are some of the most important or relevant ones. You will get to use quite a lot. So in this demo, in the next video, we're going to do the following. It will install Laravel, create a application, a very simple Hello, World application in Laravel. We're going to look at the Model View Controller and the routes, files, and photo structures. And we're going to create a simple templated syntax system by watching a template. And then we're going to render the content using the language syntax to the browser. And these are some really nice readings about Laravel, some documentations here. They have an OK documentation. It's still not the best. In my opinion, the best online documentation is still php.net. But indeed, they do assembly and nice examples as well. So the tools you need are as follows. You will need at least a PHP 8 or higher, right recommended. You can still go with 7. I'm pretty sure, but it may cause some issues. And the best way to do that is basically install XAMP on your system. Because XAMP is a program that installs a stack of other application you need already, right? The X here stands for cross-platform. The A is for Apache. M is for MariaDB or MySQL. And the P's here are for Perl and PHP. And if you are on a Mac, you want to use it. That's only for a Mac. You will use the one that says MEMP. And the windows will still WAMP instead. But I use them because it's cross-platform. Now, you also need a Composer, which is the package installer. This is not only used only for Perl. It's for the entire PHP framework. So this is synonymous to MPM when you talk about Node. So you need a Composer to do that and an IDE of your choice. There are a lot of IDEs. Any IDE will work, whichever you feel most comfortable with. You don't have to change IDE. But I'm using Visual Studio Code. I will stick with this one here. It's free open source. You already know that. The other one is the PHP Storm, which is really powerful. It's not free, but it's really robust, provided by the JetBrains team. So if you want to get a free version of that, you can follow this link here and sign up as a student or educator and some other license to give you a free for one year, OK? But in this example, I will be using just if we just do the code so that everybody can use it as well. OK, and then you also need to install the Laval CLI. It's recommended after you install Composer, right? So once you do that, just install the Laval select globally by running this command right here, OK? So that's that. Right, so Composer is really simple. I'm going to go right there right now just to show you what it looks like. So I'm using Windows. So if you're on a Windows system, just download the executable files and run the installer that way. It's very easy. You can also run in the command terminal like you see here. Just copy one of these and run it directly, OK? If you're a Mac, they all have different ways to do that as well. Mac or Linux systems, OK? So install that first. And then now down here, just a little bit history of Laval. As you can see, it's still quite young compared to other frameworks, I guess, especially the .NET. But it's been around for the last decade or so. We are now using version 9 at the time this recording. So version 10 is coming up next couple of months or so. So versions are important to understand because they can break some changes or the photo structures might change a little bit. But the framework will still be the same, OK? So just be aware of that. So down here is how you create a Laval project. Just follow these same steps. Yeah, again, I'm using the composer as opposed to the Laval. You can also create a project using the Laval command at the level of CLI itself. But for our example, we'll be using Composer to create that for us, OK? So this is the command here to run the application. Once it's installed, you use the PHP artisan command and followed by the serve function, OK? And then by default, I think it's the local host port number 8,000 is the default port number. You can use local host or you can use the 127.0.0.1, which is the same thing, OK? So here is the structure for Laval 9, the photo structure, I should say. Now, if you're using the older version of Laval or a newer version, these folder directors may change or may not be exactly what you see here. So on the left side here is the root directory. The root directory means it's the root project, right? So for example, up here, if I create my project called my app, inside my app folder, I'm going to see these folders in addition to some other files. Here, we're just looking at the directories. So there is about 10, 11 directories in here for Laval 9, all right? You will see this by default. The one I'm putting in blue here means that they will be created and scaffolded for you automatically when you install or create your project, OK? So it's important here. On the right side is what's inside this app directory. We only focus on this app directory here. So if you open the app directory, you will see these directories as well. The one I put in blue here, again, are the default ones. The one in black are only as neat basis. So if you want to create the black ones here like this, you would use the artisan command make, colon, whatever that is, and it will create these folders for you automatically in here, OK? So chances are, we're not going to probably using many of these one here, other than just the default ones. And down here is what each of these directories do, right? What do they provide and what's their purpose? So if you read about it here, you understand maybe better. But most importantly, we're going to focus mainly on the app directory, the public directory here, resources, and the routes, OK? Or mainly just mostly these up here, OK? We're not going to focus too much on the bottom ones down here. So these will be touched quite extensively, especially if you want to config and do some database activities, which we'll probably not do in this class. OK, so down here are some of the, again, information about the other directory. It's an app directory here, what these folders are. The important ones we'll be using are the HTTP, the providers, maybe just those two, OK? The other ones, we're not going to do them until when we later, but I think just those two here, right? OK, so Laravel uses a template and syntax system called BLADE. So it's called a BLADE syntax called sometimes used for the view as a BLADE view, then we mean a BLADE file. A BLADE file must have the extension dot BLADE dot PHP attached to it, OK? If you don't have that attached to the file name, it's not going to be rendered by the BLADE system. Yeah, you can still use a view, just a regular HTML PHP file, which is OK, but you're not going to be to inject BLADE syntax. So that's what it looks like. And these are stored inside the resources slash views directory, which is the one I mentioned up here. The views directory, that's from here, way up here. Inside of resources, OK? We'll see as we code. And then inside that file, open up, it will look just like this, just like a regular HTML document, or if you will, if you have a PHP document, and you will see some of these curly braces in there, these are very similar or should be very familiar. If you have been using the mustache tags for Express or Flask or Angular others, OK? So BLADE also uses this syntax here. This is for text or string interpolation. This is actually incorrect. The syntax here, I think it's incorrect because the name here should have a dollar sign. OK, I could be mistaken, but it's probably incorrect. We'll take a look. OK, so that means you're going to inject the data you're into here, and it will be parsed, and we render to the view. You see this is a hello, whatever this name is. OK, this is how a function called get is used. This is part of the HTTP protocols or HTTP verbs, how you can receive data or requests from the browser. And they're going to use to render data to the view. So to get will be a request type. You have this post, a put, a deleting options, and the patch, and so forth. OK, so based on the type of request you receive, you're going to match this pattern. This is the pattern that needs to be matched in the URL. Once it matches this pattern, then it's going to call this function here from here to here. This is, as you can see, it's a callback function or referred to as a closure in Laravel and PHP. Also known as just anonymous function, basically. So this function here returns a view. It is a view function that you pass data to it. The required parameter is the view name. OK, these are just some data parameters you pass to the component or the view to be rendered. So if you want to pass the name variable to this template here, you would pass it this way. There are a couple ways to do this, but the easier way is to use an array of key value pairs or also known as the associative array. Or I guess you can also refer to as object, right? So you do that, and when you run this to the view, you can see a message that looks like this. OK. All right, so and here are just some examples where you can use blade view versus just a PHP view file. So here is an example of a regular PHP code, right? If you have that PHP file, you have, you know, this is the HTML area. And if you want to inject PHP code in there, you can put the PHP tags and then run some code in here. I'm using here, for example, it's a 4-H loop. The loops do a variable called users, and then you loop that through here using just PHP code. OK. And if you're using the blade syntax using this as opposed to this, right? I mean, down here, this is the blade syntax. It looks kind of similar, as you can see. You're basically changing the PHP here to the add symbol, right? Pretty much that's it. And then you will use the curly braces here as opposed to the PHP echo command. So you can see it's like a replacement. So this is a blade syntax, and you will be using this as opposed to the PHP code, right? The rule is that, again, a blade file can only allow you to use the blade syntax in here, OK? Like the add symbol, the curly braces. If you do not use the blade template, if you try to inject these data into your blade template, you're going to see these just like regular text. So do not do that. Don't mistake by doing that because you will be exposing some sensitive data to the user, to the view people, right? But PHP can exist in both templates. So as you can see, in either a .php file or a blade PHP file, PHP is still that PHP. It doesn't really care, right? So therefore, if I have a file called index.php, I can render my variable using the PHP syntax. If I'm using the blade template, I can use the blade syntax, OK? But if you were to use the index PHP, and if you try to use blade syntax, then this is what you're going to see in the browser as opposed to the interpolated variable values, right? So do not do that. But PHP exists in both states. So here is that blade PHP file. I can put both blade code and PHP code, right? And here again, PHP code and blade code. So that's it's PHP's world. But I recommend not to use PHP code because that's the whole idea. Otherwise, it defeats the purpose of the blade syntax. So use it only if you must. If you don't use it, then try not to use it. You do everything in the source, right? And then just do some blade syntax here. Down here is for creating routes. We do that as well, as you can see. It takes to get, put, pose, delete, patch options in here. This is the request type that's in the route class. Use the colon, colon here. And then you pass in URL. And a callback function or again, a closure. The URL here is the pattern. The backslash is usually we reserve for the route directory. And then others will be like, for example, users and then slash and then you're an ID or something like that, right? Or about whatever. And then you have to provide a callback function to perform when the user gets to this route. What happens? And that occurs inside this event function here. So this is an event-driven function, right? That means it will not fire until you actually navigate to this URL, okay? This is an example of what crowd operation will look like. So you can see there's a get, a pose, a put, a delete. Okay, just the foremost common operations here. And for the get, you can use a get, a single ID by passing the ID variable here. Notice the curly braces followed by the ID or the field you wanna pass to that URL is what the ID here. There are other ways to do this as well. You can, we'll learn this later, but this is how you pass variable to that. And here it posts, you don't need ID. So you just basically add the data from the body of your form to that data set. Okay, and then the put. The put, you're just updating in existing ID. So that's what you need ID here. And delete a similar, you're deleting a single record, you put ID, if you delete all, you don't need ID. Okay, so these are just how it is set up. All right, so that is pretty much the very high overview of Laravel. And in the next video, we're going to go ahead and create our project and Laravel.