پی اچ پی

How to Read Code: Season 2

How to Read Code: Season 2

It's time for a new entry in our "How to Read Code" series. This season, we'll dive into the Laravel Breeze source code, taking every opportunity to peek behind the scenes to learn how and why it was constructed in this way.

While it's often unnecessary to review the underlying code of the packages and tools you use, that doesn't mean you won't benefit from doing so. If you want to become a better programmer, you must learn, read, and write a lot of code. This series focuses on the reading.

سطح متوسط 8 جلسه آموزشی 19:01:00 ساعت
قسمت 1

Before We Start

This season, we'll take a look at a first-party package: Laravel Breeze. For this style of series, we're not as focused on how to use the underlying tool (even though we'll figure that part out in the process). Instead, we're more interested in reviewing how it was constructed and wired up behind the scenes.

قسمت 2

Inspect the Install Command

In the last episode, we installed Laravel Breeze and prepared to run the initial breeze:install command. But before we do that, let's take a look at how that particular command was prepared.

قسمت 3

Registration Review

At this point in our learning, we've realized that the Laravel Breeze package is primarily an Artisan command. That's it. It's a command that copies over some existing stubs to your new Laravel project, and then updates your package.json file. This means the core of what Breeze provides is in those stubs. With that in mind, let's begin by reviewing basic registration.

قسمت 4

Breeze Uses Blade Components

If you're not yet familiar with Blade components, that register.blade.php may initially seem odd. What are all these HTML-looking x-application-logo and x-auth-card tags?

قسمت 5

Email Verification Research

As we finish up our review of registration, this will give us an opportunity to step outside of Breeze and look at how Laravel handles email verification. As part of this lesson, we'll also install MailHog, which will allow us to easily intercept and review emails that our application sends.

قسمت 6

You Are Responsible for the Code

After you install Breeze into your application, you are entirely responsible for the code. You can adjust the code how you see fit to suit your current project.

قسمت 7

Password Confirmation Deep Dive

Let's review the basic flow for requiring password confirmation before loading a particular route. Pay special attention, because in the following episode, we'll rewrite the functionality from scratch.

قسمت 8

Rewrite the Password Confirmation Functionality

It's important that we don't fall into the trap of reading a lot of code, but rarely writing any of our own. With that in mind, let's take what we learned about password confirmations in the previous episode, and rewrite the functionality from scratch. Think of it like a kata. Once finished, we can throw away the code entirely. The goal is to focus on general workflow and habit building.