Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 8, 2020 12:13 am GMT

Build A Simple Blog Using PHP and Laravel (Beginner's Guide)

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

Demo

Here is a demo site Ive built: http://laravel.demo.techjblog.com/

Login Information

email: [email protected]

password: demo

Getting Started

img

Lets 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.

Some Useful Tools For Web Developing (PHP)

Laravel Tutorial #1: Setup the Project

Laravel Tutorial #2: Routes, Views, Controllers and Models

Database

Designing Database Solutions for SQL Server 2016

One of the most important steps of web developing is to design the database structure. In this tutorial, well make four database tables together.

The users table stores the user name, email and password. The migration file for this table is already included in Laravel. The categories and tags tables store the category names and tag names. And finally, the posts table stores the post title, content, post image and so on.

Laravel Tutorial #3: Database Structure

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.

Laravel Tutorial #4: Relationships

Admin Panel

img

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.

Laravel Tutorial #5: Admin Panel (Voyager)

However, the problem with open-source projects is that you could lose the communitys 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.

Laravel Nova: The Perfect Admin Panel For Your Laravel Apps

Routes, Controllers and Views

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.

Laravel Tutorial #6: Routes and Controllers

Views are what we actually see in the browser, so they do look like HTML and CSS. However, things are more complicated than that.

Laravel Tutorial #7: Views

Deploy

Now we can finally deploy our site.

Laravel Tutorial #8: Deploy

Digging Deeper

14 Bootstrap Search Bar Box Design Examples - OnAirCode

If you are interested in developing more functions for your blog, check out this post.

Laravel Tutorial #9: Search, Pagination, Related Posts and Other Functions


Original Link: https://dev.to/ericnanhu/build-a-simple-blog-using-php-and-laravel-beginner-s-guide-25kf

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To