Hey guys! I've completed my first tutorial on PHP and Laravel. I this tutotial, we'll go through the basics of the Laravel framework by building a simple blogging system. Note that this tutorial is only for beginners who are interested in web developing but don't know where to start. If you are an experienced coder, it will be very boring for you. Check it out if you are interested: Laravel Tutorial For Beginners
Here is a demo site I’ve built: http://laravel.demo.techjblog.com/
Let’s start by making some preparations, install the necessary software, create a new Laravel project, and then, we need to talk about the MVC structure, which is commonly used by most of the web frameworks.
One of the most important steps of web developing is to design the database structure. In this tutorial, we’ll make four database tables together.
users table stores the user name, email and password. The migration file for this table is already included in Laravel. The
tags tables store the category names and tag names. And finally, the
posts table stores the post title, content, post image and so on.
However, just creating the tables is not enough. The tables have relationships between each other. The part could be a little tough for beginners, I will try to make it easy to understand, and only introduce four most basic relationships.
Every website requires an admin panel where you can update new content to your site, and in this tutorial, I will use Voyager as an example.
However, the problem with open-source projects is that you could lose the community’s support anytime, and it is not as secure as commercial panels. So, if you are interested, Nova is also an excellent choice. But unfortunately, it is not free.
The following two articles are the core components of this tutorial.
Routes are the entry points when someone visits your blog. They receive URLs and returns controllers. Controllers retrieve data from the database through models and put them in views.
Views are what we actually see in the browser, so they do look like HTML and CSS. However, things are more complicated than that.
Now we can finally deploy our site.
If you are interested in developing more functions for your blog, check out this post.