Welcome and Series Introduction
Hey, what's going on guys? Welcome back to our YouTube channel. And as promised, we're finally going to get into Laravel. We have had some requests to this tutorial and I do have some good news for you, which is that this is gonna be a tutorial series. So initially we wanted it to be a crash course, but we came here, quickly came to find out that to include all the parts are horrible that we want to cover, it's not going to fit in one hour or an hour and a half. And I think most of you guys prefer the modular type or modular format rather than having a crash course.
So this year is we're going or we're not just going to be covering the fundamentals of Laravel, we'll also be building a project from start to finish. And in this video, we're going to take a look at what we will be building and we're also going to talk a little bit about Laravel and some of the things that it can do. By the way guys, if you are new to this YouTube channel and you want contents about programming tutorials, we have a lot of topics like Java, PHP, Python and other topics available. So I highly suggest that you subscribe to this YouTube channel and press the notification bell so you'll get updated whenever we have a new upload.
Alright, so before we get into what we will be doing, let's talk a little bit about what Laravel is.
What is Laravel? MVC Explained
So Laravel is an open source PHP framework and creators of Laravel have said many times that we aim to make the development process pleasing without sacrificing quality. So Laravel is very elegant and things just kind of seem to work together very nicely. Also Laravel is not only popular but also respected today. And Laravel uses the MVC or Model-View-Controller design pattern.
So we will be talking about that throughout the entire series but the basic idea is that the Model deals with the database, the View is the user interface that displays in the browser, and the Controller handles requests which come from either URL or forms such as the POST, GET, DELETE and other requests coming from URL and forms.
Course Outline and Project Goals
Alright guys, these are the topics that are included in this particular series. So I think we already cover the first one which is the Laravel overview. So we have discussed some of the strong points of using this PHP framework and also some of the advantages of using Laravel. Also, I'm going to guide you in the installation or setup so we could get up and running with this Laravel framework in our local development machine. And also in this series we're going to build a website and a blog application with authentication and access control. And of course at the end of this series we should be able to deploy our own or our very own Laravel application.
Why Use Laravel Over Building from Scratch?
Alright, so now that we get that out of the way let's talk about what Laravel actually does for us. So why would we choose to build an application with Laravel over just building it straight up from scratch? So actually there is too many reasons to list, so I listed here the important ones.
So Laravel handles routes in an extremely simple way. You can simply define what URL and what type of request that you want to handle. Now most MVC PHP frameworks do this as well as you know, such as CodeIgniter, CakePHP, but some of them, some of the routing files are really difficult when it comes with expressions and dynamic URLs and things like that. So Laravel makes everything very, very simple which make it a great candidate for RESTful API.
And also Laravel adds a security layer to your application. So it automatically escapes what it needs to and it also implements cross-site protection with forms and submitting to the database. So whenever we are submitting data to our database, Laravel takes care of the intricacies of the security inside our application. So among other things, working with database is also easy or very easy.
Artisan, Blade Templating, and Authentication
Laravel is shipped with an awesome command-line tool called Artisan and it lets us do pretty incredible things with just a single command. So one of those things is to create database migrations. Laravel also uses the Blade template engine to display views. So it means that we can extend layouts, we can use control structures like loops and conditionals right inside the HTML.
So there's also there's many different ways to implement authentication but Laravel sets that up for us to automatically create migrations and to create the user table. And all we have to do is run a simple Artisan command to enable everything and enable authentication. Also Laravel can handle sessions. So we're going to do that or we're going to discuss that later in this series and also Laravel provides us with mechanism to compile assets.
Additional Laravel Features
with all the intricacies of storage and file management and also it comes with error handling. So error handling is very important especially with bigger projects and it is very important to have this type of module or type of feature in a framework when it comes to handling errors.
And also we have the unit testing but I think we're not going to touch that in this series but it worth mentioning that Laravel comes with unit testing mechanism. Also email configuration for SMTP. So if you wanted to have like a verification emails sent from your application and things like that. And Laravel also handles cache pretty well. So these are just some of the things that some of the benefits to using this framework.
Development Environment and Setup
So as far as environment goes, our development environment I'm going to be using Windows and we're going to use WAMP which gives us an Apache server, PHP and MySQL on our local machine. But Laravel is completely cross-platform so even if you are using Mac or using Linux you can use something like them or mom for your development. And installing Laravel is also pretty easy. We're going to use Composer which is a dependency manager. So this is kind of like an NPM if you are a JS developer. So we're going to install that and then we're going to run this simple command to create a new Laravel project. So by the way you can download the composer from getcomposer.org website. I think I have already mentioned that Laravel comes with the artisan CLI.
Introduction to the Artisan CLI
It will enable us to handle many tasks so the number one is to create controllers and models. We can use Artisan CLI command for that when we are trying to create controllers and models and later on I'll be showing you some of the example commands that we can use for this particular task. So creating database migration files and running migrations, also we can we can use the artisan CLI for that, create providers, events, jobs, form requests and other tasks related to this. And also we can show the routes, we can also issue session commands, we can also run tinker, and also we can create custom commands by using the Artisan CLI.
Artisan Command Examples
And these are the examples of Artisan commands. So we have the php artisan list, we also have artisan help migrate, also artisan make:controller and your controller. And here's the one if we want to make a model, so artisan make:model and then the name of the model and -m. And also we have the php artisan migrate. And last example here is artisan tinker. So all of these commands or some of these commands we're going to use later in this tutorial series and other commands that probably we need in our development process. So I think that's it for this tutorial.
Conclusion and What's Next
And in the next video we're going to look up how to set up our environment and install the Laravel. So by the way, if you're new here in our YouTube channel and you want content about programming, so I highly suggest to subscribe and press the notification bell so you'll get updated whenever we have a new upload. Thanks.