Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Browse all series

Demystify Laravel's Magic

In this series, we'll demystify much of Laravel's magic for developers who may not understand how all the pieces fit together behind the scenes. We'll cover a variety of confusing topics, like providers, facades, contracts, and more.

Progress

Series Info

Episodes
6
Run Time
30m
Difficulty
Advanced
Last Updated
Jun 26, 2023
Version
Latest

Series Episodes

  1. Episodes (6)
    1. Aliasing Classes

      In this opening episode, we'll review how Laravel aliases some classes to make it easier to use them within code and Blade templates, and how this trick is used in the tinker command.
    2. Understanding Laravel Facades

      In this lesson, we will demystify the inner-workings of facades in Laravel. Facades are a way to resolve dependencies from the Laravel dependency container without having to require them in a class constructor.
    3. Real-time Facades

      In this video, I will demonstrate some black magic. We can use a facade without ever creating it. This is called a real-time facade; it's a great way to quickly test a package or a Laravel feature.
    4. Laravel and the Reflection API

      In this video, we will explore how Laravel uses the reflection API to enhance the developer experience. We will review examples of how Laravel leverages reflection to automatically resolve dependencies and bind values to closures, as well as how it uses contextual binding and reflection to register event listeners. Understanding these magic tricks will make your life as a programmer much easier.
    5. Macros Let You Extend Laravel Components

      In this lesson, I will show you how to leverage macros to extend Laravel's various components. I will demonstrate how to register macros to the Command class and explain how mixins allow you to define a group of macros inside a single class. While macros can be useful, it's important to use them wisely and communicate with your team about their usage.
    6. Why Magic in Laravel Confuses Developers

      In this lesson, we'll discuss why magic in software engineering, specifically in Laravel, can be confusing for some developers. Ultimately, of course, the decision to use or avoid magic in your code is up to you.

Continue Learning