Introduction to Laravel for PHP Beginners
So once you learn PHP, the next step is to learn something called a framework. And today, we're going to start learning something called Laravel, which is a very popular framework that we use together with PHP in order to develop websites much easier and much safer.
It has been heavily requested that I do a Laravel tutorial, so that's what we're going to start doing today. This video here specifically is going to focus around what exactly Laravel is and why we need to learn it when it comes to PHP development. Because there's a lot of beginners sitting out there who might be looking at something like Laravel and thinking, "Well, okay, why can't I just build something using PHP on a website without having to do it using a framework?"
And then in the next video, we're going to start learning how to actually install Laravel, which is a huge hurdle for a lot of people since it is something that, at least the first time you do it and maybe the second and third time, might give you a few hiccups. So we're going to try and do this as smoothly as possible to get people into Laravel and to teach you how to install and use Laravel in order to develop different types of websites.
Why Use a Framework Instead of Raw PHP?
So for now, let's go ahead and talk a bit about why exactly Laravel is so important to learn. Because Laravel is something that everyone talks about, but why do you need to learn it? 'Cause why isn't regular PHP just okay if you want to build a website?
And of course, there's many different reasons for why, but for a complete beginner, it can be a little bit difficult to understand what the difference is between building something using just raw PHP versus using a framework, whether that being Laravel or Symfony or any other kind of framework that's out there. I do also think this is one of the biggest misunderstandings when it comes to anyone learning any sort of programming language, like for example PHP, which is also the way that people teach it in universities. Like they teach people how to program certain languages such as HTML, JavaScript, PHP, whatever. And by the time you learn PHP, you then think, "Okay, well, now I'm done. I can go out and get myself a job at just any sort of place where they need some sort of PHP developer."
But you're going to notice that if you actually go and try and search for a job, a lot of them are going to require a certain framework that you need to know. And the main reasons for learning one of these frameworks, like for example Laravel, is that when you actually go and get a job, you're going to be sitting with other developers and you're all going to be sitting working on maybe the same project, maybe you're working on different projects but need each other's input between them. And when doing that, you need to be able to know what is going on in each other's code.
Or to put it in another way, if you're all sitting as developers, you know, around the office and everyone is coding raw PHP whenever they're building any sort of application, then Thomas might be coding in a certain way, because you know, programming can be done in many different ways. And then we have Julia sitting over there programming in another way because that's how she's used to programming it. It is going to be messy and people are going to, you know, have different ways of programming that are going to interfere with each other and it's just not very organized. So therefore, having a framework makes a lot easier if you sit inside a workplace working as a PHP developer.
The Security and Automation Benefits of Laravel
And another really good reason to learn Laravel is also the fact that a lot of things get automated when you do actually want to build something using PHP. So let's say I want to build a login system, but I would then need to build everything from scratch. I would need to have all the security in order, I would need to set up the databases correctly. There's a lot of things that needs to be correct when it comes to PHP because you're handling data, so you need to make sure that there's no weaknesses that can be exploited so that people can steal the data or something else might break. So PHP is very, very data-sensitive, so that people don't go in and actually steal it.
And this is one of the big misconceptions when it comes to people wanting to build something using raw PHP, which is okay to do, but anytime you want to handle data, there is something like Laravel that can go in and give you some sort of built-in feature that already has an authentication system that has good security. So instead of you having to sit there and build everything manually, and maybe you don't have the skills to do so—which would be a really bad thing, especially since PHP handles user data—Laravel can come in and actually fill those shoes in for you because it has built-in security that you can take advantage of in order to build applications that are secure much faster.
So whenever people ask me, "Why do I need to learn a framework?" it's because it's not really that secure if you do it yourself, unless you are an expert at what you're doing. And you do also want to have things automated to make faster websites, because time is money. And you need to be able to work together with other people and build things in the same way, which makes it a lot easier if you're all following the same framework.
Laravel's MVC Structure & a Key Prerequisite
So to talk a bit about what exactly Laravel is. So far we have concluded that is a framework that has different libraries inside of it to make development easier and fast and more secure. But it's also something that is based on the Model-View-Controller, which is the MVC model. So if you don't know about classes and objects and just in general object-oriented PHP, then it is recommended that you know about object-oriented PHP before getting into Laravel. And again, it's not something that's required, but it just makes it a little bit easier to understand how the structure is when you get into Laravel since it is based on a Model-View-Controller. So I do have a course that you can follow if you want to, to just kind of get the basics of what exactly the MVC model is, that you can follow and then you can always return to this video here if you want to do that first and then continue with Laravel so you actually know a little bit about the MVC model before we get started.
This actually touches upon another good point that has been discussed on my channel and many other places, which is should you learn object-oriented PHP? Because procedural PHP is good enough. Well, if you want to go out and actually work with PHP in a working environment, then you do need to learn object-oriented PHP because in the real world, when you get a job, you will need to learn object-oriented PHP. So it is very important to learn object-oriented PHP, even though it is kind of a, ooh, you know, do I want to touch that kind of thing for a lot of people because it looks a little bit more complex than procedural PHP. But it is something that is relatively easy to learn as long as you have the proper person teaching you. So hopefully that is me, but in this case here, you do need to learn just the basics of object-oriented PHP.
Scalability, Popularity, and Community Support
So now if we were to talk a bit about what exactly you can build using Laravel, you can very easily build both small, medium, and large websites. So if you want to build any sort of size website, you can use something like Laravel. So you don't need to worry about scalability. It's actually quite good to use Laravel if you want to have scalability inside an application. So Laravel is a very robust, powerful tool when it comes to building any sized website.
And also just to kind of mention it, it is also one of the, if not the most popular PHP framework out there right now. So if you want to learn a framework, this is most likely the one that most places will use. Again, it's going to depend a little bit depending on the country you're sitting in, but in most places, Laravel is the most popular option. And because of that, it does also come with a lot of documentation. So there's a lot of people sitting out there teaching and sharing how to do things using Laravel. So Laravel is also one of those kind of frameworks that you can learn that will also have a community that can help you, you know, build your application, because it has a lot of documentation. So you don't need to worry about there being not many places you can go for information, because there will be.
Conclusion and What's Next in the Series
So with all that said, now you know a little bit about what exactly Laravel is. You know it's a framework, it has libraries in it that we can use, you know, to build applications much faster when it comes to PHP websites. And just in general, it's a very good tool to use inside a workplace because it makes it a lot easier to work on a project together. And it does have a small requirement of needing to learn, just, you know, you need to learn PHP, but then you also need to learn just like the basics of object-oriented PHP. At least, it's not required, but it'll make it easier for you to get along with this lesson here if you know what the MVC model is.
In the next video, we're going to talk about how to install and set up Laravel, which is a hurdle for a lot of people that want to get into Laravel because it is something that can give you error messages and just kind of fight you along the way. So we're going to try our best to navigate through the installation process so you can actually get it installed on your computer in the easiest way possible.
So with that said, I hope you enjoyed and I'll see you guys next time.