21 Laravel Tutorials for Learning Laravel in 2021

Tutorials

January 1st, 2021

2021.jpg

2021 is a great time to learn Laravel and improve your knowledge if you’ve been using it. To start the year off we’ve made a list of 21 tutorials on everything from getting started to going deeper with the framework.

Getting Started with Laravel Tutorials

Laravel from Scratch

In this step by step Laracasts series, you’ll learn how to build web applications with Laravel. You’ll start with the basics and incrementally dig deeper and deeper, as you review real-life examples. Once complete, you should have all the tools you need.

Step by Step Guide to Building Your First Laravel Application

In this tutorial, you’ll go through building a simple link directory app. It covers everything from planning, setting up your database, Blade views, and more. Join our weekly Laravel newsletter and get this as a free PDF.

Laravel Release Process

As you begin to work with Laravel one thing you should note is how the release process works and when new versions are scheduled to come out.

Building a Vue SPA with Laravel

This is a multiple part series taking you through building a Vue SPA with Laravel. part 1, part 2, part 3, part 4, part 5, and part 6.

Laravel Eloquent

Laravel Eloquent is an object-relational mapper (ORM) that makes it easy to interact with your database. When using Eloquent, each database table has a corresponding “Model” that is used to interact with that table. In addition to retrieving records from the database table, Eloquent models allow you to insert, update, and delete records from the table as well.

Learn to master Eager Loading

At its core Eager Loading, is telling Eloquent that you want to grab a model with specific relationships that way the framework produces a more performant query to grab all the data you will need. By eager loading, you can take many queries down to just one or two.

In this tutorial, you’ll set up some example relationships and then walk through how queries change with and without eager loading.

6 Laravel Eloquent Secrets to improve your code

In this tutorial, we’ll show you more or less hidden secrets, methods, and properties you might not know to improve your code.

20 Laravel Eloquent Tips and Tricks

Eloquent ORM seems like a simple mechanism, but under the hood, there’s a lot of semi-hidden functions and less-known ways to achieve more with it. In this tutorial, you’ll see and discover a few tricks you might not know about.

Laravel firstOrNew, firstOrCreate, firstOr, and updateOrCreate methods

If you’ve been working with Laravel for any time, you probably know the standard methods for creating Eloquent Models like make(), create(), update, and save(). Laravel includes some other methods are that also really useful for creating and updating Models that I feel don’t get enough attention. In this tutorial, you’ll learn about some of these additional methods and see how they might be useful.

Laravel Validation

Laravel Validation 101

A core part of any project is understanding how to validate the incoming request from your users and in this tutorial let’s look at how we can setup validation with our controllers, form requests, and rules.

Testing Length Validation in Laravel

Learn how to work with and test string length validation.

Add a Check For Pwned Passwords In Your Laravel Form Validation

Have I been pwned? is a service created by Troy Hunt that aims to archive all data breaches and then allow you to check and see if your email or username has been included in any breaches. It’s a super helpful service to see if your email or password has been found in a breach and in this tutorial learn how to utilize this data in your Laravel Validation

Laravel Helpers

Creating your own Laravel Helpers

Laravel provides many excellent helper functions that are convenient for doing things like working with arrays, file paths, strings, and routes, among other things like the beloved dd() function. You can also define your own set of helper functions for your Laravel applications and PHP packages, by using Composer to import them automatically.

5 Laravel Helpers to Make Your Life Easier

There are a ton of helper methods in Laravel that make development more efficient. If you work with the framework, I encourage you to see what helpers you can introduce in your day-to-day work. In this post, I’d like to point out a few of my favorites.

Going Deeper

Laravel Jobs and Queue 101

In this tutorial, learn all about Laravel Jobs and Queues by building a simple analytics app.

Using Laravel Sanctum to authenticate a React SPA

Sanctum is Laravel’s lightweight API authentication package. In this tutorial, we’ll be looking at using Sanctum to authenticate a React-based single-page app (SPA) with a Laravel backend.

Laravel Model Events

Laravel Model events allow you to tap into various points in a model’s lifecycle, and can even prevent a save or delete from happening. The Laravel model events documentation outlines how you can hook into these events with event classes, and this article aims to build upon and fill in a few additional details on setting up events and listeners.

Tips to speed up PhpUnit

Having a fast test suite can be just as important as having a fast application. As a developer, getting feedback quickly about the state of your code allows for a much quicker development turnaround. Here we are going to run through some tips you can implement today to make your tests run faster.

Seeding Data for Testing

In this tutorial, you will create a test case to test the user model and a seeder to seed ten users, and each is following one user into the database.

Improve Your Routing with these tips

In this tutorial, get a quick jumpstart on learning how to use routing in your Laravel applications.

Laravel Model Factories Tutorial

Laravel comes with a feature called model factories that are designed to allow you to quickly build out “fake” models. These have several use cases with the two biggest being testing and database seeding. Take a deeper look at this feature in this tutorial

Increase Your Terminal Productivity

Many great developers could improve and gain some productivity and better tooling in their Terminal, so take a look at this tutorial for improving your productivity.

Wrap up

2020 was quite a strange year for everyone but even during the pandemic Laravel continued releasing new versions, making improvements, and getting better. In 2021, look for the release of Laravel 9 and 10, as well as more conferences, and hopefully more in-person meetups as things go back to normal.

Filed in:

Eric L. Barnes

Eric is the creator of Laravel News and has been covering Laravel since 2012.