Laravel Tutorial For Beginners

Good news! I have updated this tutorial for Laravel 8!

Laravel is a very powerful framework that follows the MVC structure. It is designed for web developers who need a simple, elegant yet powerful toolkit to build a fully-featured website. This tutorial explains the basic use of Laravel 8 by building a simple blogging system.

You can download the source code of this tutorial here.

Demo

Here is a demo site I’ve built: http://laravel.demo.techjblog.com/

Login Information

email: demo@demo.com

password: demo

Part One: Laravel Basics

Before we can start building our project, we need to talk about some basic concepts in Laravel. Let’s start by making some preparations, install the necessary software, create a new Laravel project, and then, we need to understand the MVC structure, which is commonly used by most of the web frameworks. And finally, we’ll talk about Laravel Nova, the official admin panel for Laravel applications.

Part Two: Build A Blog

One of the most important steps of web development is to design the database structure. In this tutorial, we’ll 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.

However, just creating the tables is not enough. The tables have relationships with each other. This part could be a little tough for beginners, I will try to make it easy to understand, and only introduce the four most basic relationships.

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.

In the next two articles, we’ll build search, pagination and some other optional features for our project. However, if you are not interested, feel free to jump to the end, and we can finally deploy our application.

Other Resources

Some Useful Tools For Web Development (PHP)

Laravel Official Documentation

How to Use Voyager: A Free Admin Panel For Laravel Apps

Book Recommendation

Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5

Build interactive, data-driven websites with the potent combination of open source technologies and web standards, even if you have only basic HTML knowledge. In this update to this popular hands-on guide, you’ll tackle dynamic web programming with the latest versions of today’s core technologies: PHP, MySQL, JavaScript, CSS, HTML5, and key jQuery libraries.

Programming PHP: Creating Dynamic Web Pages

Why is PHP the most widely used programming language on the web? This updated edition teaches everything you need to know to create effective web applications using the latest features in PHP 7.4. You’ll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms.

Laravel: Up & Running: A Framework for Building Modern PHP Apps

What sets Laravel apart from other PHP web frameworks? Speed and simplicity, for starters. This rapid application development framework and its ecosystem of tools let you quickly build new sites and applications with clean, readable code.

Leave a Reply

Your email address will not be published. Required fields are marked *