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

Browse all series

Jeffrey's Larabits

Here, you'll find Jeffrey Way's personal collection of Larabits. If you're unfamiliar, Larabits are short, isolated lessons that focus on a single concept or technique. While a typical series may take hours to work your way through, Larabits are instead for when you have five or ten minutes to pick up a small bit of knowledge.

Please keep in mind that each of these lessons is self-contained and may be viewed in any order. Happy learning!

Progress

Series Info

Episodes
52
Run Time
13h 1m
Difficulty
Intermediate
Last Updated
Apr 11, 2025
Version
Latest

Series Episodes

  1. Episodes (52)
    1. Meet Bob, My New Personal Assistant

      The world decided that I needed to see 10,000 posts about Clawdbot this last weekend. It was frustrating. It was annoying. It felt like a psych-op. ...So I had to try it out.
    2. Build Your First Telegram Bot In Record Time

      You might not realize this, but it's actually incredibly easy to build a Telegram bot to assist you with any task or administrative action that needs to be performed while you're away from your computer.
    3. Browser Testing is No Longer Horrible

      Pest v4 just dropped with built-in browser testing (powered by Playwright). It's absurdly good. Come along, as I review it for the first time. We'll begin constructing browser tests for a gift certificate checkout flow at Laracasts. Ready?
    4. How To Boost Your Laravel App In Minutes

      Let me show you how you can boost your Laravel app with a single command. Seriously - I'm not joking. We'll vibe code an exam engine, while taking advantage of drastically improved AI guidelines, documentation, and tooling. Let's go!
    5. Laravel Wayfinder Is The Way

      Laravel Wayfinder is a brand new package from the Laravel team that allows you to call any of your Laravel route endpoints from your front-end code without requiring that you hardcode their respective URIs. Ths package instantly sold me on its usefulness. Have a look!
    6. This CSS Grid Sizing Trick Feels Like Magic

      When working with CSS Grid, you’ve almost certainly fallen into a trap where you can’t specify the number of columns because the grid items are dynamic: sometimes two items, sometimes four items. In this Larabit, I’ll demonstrate how to use the auto-fit, auto-fill, and minmax() properties to address this issue.
    7. PHP Attributes and Custom Collections Simplified

      Laravel recently added support for a new CollectedBy class attribute. This allows you to quickly specify a custom Collection class for your model. But PHP attributes can initially be confusing, so let's break this feature down and build it up from scratch for maximum understanding.
    8. Contextual Attributes in Laravel. Huh?

      Laravel now ships with support for contextual attributes. It's a confusing term, but incredibly useful. In a nutshell, it allows you to dynamically resolve dependencies from the container at runtime, providing different implementations depending on the context in which they're used. Let me show you a few examples to make it a bit more clear!
    9. Code Splitting, Chunks, and Laravel Prefetching

      When it comes to single-page apps, we often have to choose between shipping a single large bundle, or reaching for code splitting. There are pros and cons to each option. Generally, this reduces to whether you prefer that the user pay the download toll up front, or spread it out from page to page. However, there's now a way to get the best of both worlds!
    10. Execute Code After a Response is Returned?

      The latest version of Laravel 11 includes a useful defer() function that allows us to execute a bit of logic after the response has been returned to the user. For any relatively long-running task, this can be a game-changer. Let's review how it works!
    11. Eloquent's New Chaperone Method

      The latest version of Laravel 11 ships with a new chaperone method for Eloquent models. Cutely named, it solves an N+1 problem that likely every one of us has encountered at some point or another.
    12. The Intermediate Developer Trap

      All it takes is one book about SOLID to radically transform the way you write code. Often, it's a transformation for the better. ...But not always. Let's chat about what I call the intermediate trap, or the tendency to turn a small handful of lines into a web of confusion. In this Larabit, we'll reverse-engineer our code for the better.
    13. Laravel Socialite and Github Authentication Workshop

      In this workshop, we'll review how to use Laravel Socialite to implement Github-based authentication into an existing application. We'll review the general workflow, as well as some gotchas that you might run into along the way.
    14. An Anchor Within an Anchor?

      Have you even run into a situation where you wanted a card or panel in your UI to be clickable, but still include child links as well? An anchor tag can't contain nested anchors, so how do we solve this problem? Let me show you one quick solution.
    15. Let's Have a Dialog

      Think of the HTML dialog element as a browser-native modal. Much of the functionality that you would traditionally need to implement from scratch is available from the get-go. In this Bit, over the course of eight steps, I'll show you the bulk of what you need to know.
    16. CSS-Only Radial Progress Bars

      Have you ever seen those thin radial progress bars? Traditionally, JavaScript is used to implement this particular effect? But, these days, we can achieve the same result using only CSS. The secret is to leverage conic gradients. Let's learn how.
    17. Laravel Folio First Look

      Laravel Folio is a powerful and unique new page-based router for your Laravel applications. Announced at Laracon US 2023, it offers an alternative ways to organize your routes. Simply create a new file and, bam, your route is ready to go! Though not for everything, you may find this new approach to be just what the doctor ordered for your next app!
    18. Laravel Herd - First Look

      In this Larabit, we'll explore a brand new tool that was announced at Laracon US: Laravel Herd. Herd is an incredibly fast one-click development environment for Mac that includes everything you need to immediately begin developing Laravel applications. Let's have a look together!
    19. How to Make a Passwordless Login System

      In this Larabit, I'll show you how to build a passwordless authentication system from scratch. We'll start with Laravel's Breeze scaffolding, and then we'll perform the necessary adjustments to make it passwordless. Specifically, we'll leverage temporary signed urls to make the entire process a cinch!
    20. ChatGPT Schools Laracasts Owner

      Here’s the thing: I’m a little tired of hearing about ChatGPT, too. But it’s all for good reason! Until 2022, few of us realized just how advanced AI had become. It’s truly a turning point in the programming community. And we can either get on board, or worry. Let’s do both.So with that in mind, I thought it might be fun to let ChatGPT be my Laravel teacher for a day. Can it give me step-by-step instructions for implementing a new feature from scratch? Let’s find out!
    21. Jeffrey Reviews Pest for the First Time

      I’ve become a late adopter in recent years. Now that I’m older, with a family and increased responsibilities, I’m happy to let others lead the initial trials for new tools. However, I can no longer push the pause button when it comes to Pest, a PHP testing framework. The excitement is palpable, and, so, it seems I must finally learn for myself what all the fuss is about.If you’d like to come along, join me as I review and decipher Pest for the first time in this video. Together, we’ll learn the basics and then conclude with the most important question: “Will I be switching to Pest?”
    22. Laravel's New Strict Mode

      For a variety of reasons, Laravel - and specifically Eloquent - can sometimes be a bit more lenient than you might prefer. It might be nice, for example, to instantly know when you've introduced an N+1 problem or accessed a model attribute that doesn't exist. However, there is a way to turn on a "strict mode." I'll show you everything you need to know.
    23. Tiny Refactors Make a Big Difference

      In this Larabit, we’ll review some deconstructed, but typical real-life messy code that you’ll often find in the programming wild. Specifically, I want to talk about how, often, it’s the tiny refactors that can add up to make a massive difference in your applications.
    24. 6 New'ish HTML Tags You Can Use Right Now

      Today, we'll talk about plain old HTML. I get it: you learned HTML years ago. But since then, countless new HTML tags have been introduced that you might have missed. In this Larabit, we'll discuss six tags that you can use right now. Many of them offer native control-like behavior for free.
    25. From Zero to "Log In With GitHub" in Ten Minutes

      The wonderful thing about Laravel is that, if there’s something specific you need to accomplish, then there’s probably a tool that will help you get there.To illustrate this, let’s leverage Laravel Breeze and Laravel Socialite in this Larabit to build a fully functioning registration system with GitHub sign in…in a matter of minutes.
    26. Techniques for Improving Test Performance

      In this Larabit, we’ll review a small handful of techniques that you might consider for situations where test speed is paramount. If you’re not careful, you may suddenly find that a single test can balloon up to ten seconds or more. This can easily happen if you don’t avoid unnecessary relationship loading, model events, irrelevant notifications, and more.
    27. Simpler Modals With the Dialog Element

      The HTML dialog element can be used to create custom alerts, prompts, or general modals. Even better, browser support has reached the point that it can now safely be used in your projects. In this Larabit, I give you a crash-course in its usage. We'll review toggling the dialog, the full API, and how to register and respond to events.
    28. Cypress and Laravel Crash-Course

      If you're unfamiliar, Cypress is a wonderful end-to-end test framework that runs in the browser. I've recently been working on improved Laravel integration for Cypress that provides support for all of the typical tasks that you'd likely need to execute. This includes authentication, model factories, database migrations, seeding, and much more.If you'd like to come along for ten minutes or so, I'll show you how easy it is to use.
    29. Enable Automatic Tailwind Class Sorting in 4 Minutes

      In this Larabit, let's enable automatic class sorting in four minutes.
    30. Solving the CSS Viewport Height Quirk in Mobile Safari

      There's an awkward quirk in mobile Safari that makes it frustratingly difficult to work with CSS viewport height (vh) units. While there are official CSS spec solutions in the works, at the time of this recording, these solutions do not yet work in any browser. As such, we'll need to resort to hacks. In this Larabit, I'll show you a JavaScript-specific way to handle this annoying problem.
    31. A New Way to Define Accessors and Mutators

      The creator of Laravel, Taylor Otwell, recently introduced a new, improved way to declare accessors and mutators on your Eloquent models. While the traditional getNameAttribute and setNameAttribute syntax won't go away, I think you'll appreciate this new single-method approach for being a bit more in the Laravel spirit. Let's take a look.
    32. From Zero to Markdown Converter in 10 Minutes

      Did you know that Laravel includes a helpful Markdown converter out of the box? A single line of code is all you need.In this Larabit, for fun, we'll build a real-time Markdown converter UI in ten minutes. This UI will take the shape of a two-column grid. On the left is a basic Markdown textarea, and on the right is a dynamically updated HTML preview of that Markdown.
    33. Mode and Keybinding Primer for the Vim-Curious

      The programming world splits into two groups: those who use Vim exclusively (and will do so until the day they retire), and those who don't, but are still a little Vim-curious. If that's you, in this Larabit, I'll give you a crash-course in how to use some essential Vim keybindings in your code editor of choice.
    34. Service Containers in 3 Levels

      In this Larabit, I'll teach you the essentials of how to build a service container in three levels.Beginning with level one, we'll prepare a laughably basic container to illustrate the general concept. For levels two and three, we'll slowly work our way up and develop a container that can perform bindings, handle singletons, and even magically instantiate dependencies on the fly.
    35. CSS Properties You May Not Know

      Let's step away from the backend and instead play with some CSS properties that you don't usually encounter in your typical day-to-day workflow. Without any specific end goal, we'll tinker with CSS clip paths, wrapping text around arbitrary shapes, animations, and more.All of these are properties that you can be using in your projects right now.
    36. I Think I Can

      As part of Laravel v8.70, we can now chain a can() method directly off of a Route declaration. Let's review a quick example that provides a before and after illustration.
    37. Custom Artisan Commands Exercise

      Custom Artisan commands are one of the more intuitive and powerful features of Laravel that newcomers often avoid - at least initially. But you shouldn't avoid them. They're incredibly easy to construct and configure to the needs of your app.In this Larabit, we'll use the example of a custom tail command to demonstrate how easy these things are to build.
    38. Refactor Messy Conditionals to Lookup Tables

      For this Larabit, we'll be working directly with the Laracasts source code.At the time of this recording, I'm currently working on a group "Social Feed" for our forum, and need to render a particular text fragment based on the type of activity that took place. In these situations, while we could resort to a long series of if-else statements, a cleaner approach would be to instead extract a basic lookup table.
    39. An Essential Tool in Your JavaScript Belt

      In this Larabit, we'll have a look at what I consider to be an essential tool in your JavaScript belt: ESLint. Eslint will statically analyze your JavaScript source code and detect problem areas, based on a set of rules that you apply. For example, Vue component properties must be in this particular order. Or, Yoda conditionals should always be disallowed. But not only that, ESLint can often fix these issues for you automatically. Let's have a look at how to integrate this excellent tool into your own workflow.
    40. New in Laravel: Lazy Database Refreshing

      Here's a small, but very useful new addition to Laravel. The default TestCase class now includes a new LazilyRefreshDatabase trait, which will only refresh your database if the current test touches the database.
    41. 3 Building Blocks for Any Collection

      In this Larabit, you'll learn some of the core infrastructure for any collection component. If you use Laravel collections, you might understandably take it for granted that you can, for example, count a collection, or loop over it, or interact with it as if it were an array. But these things aren't magically available. They have to be implemented. Should you need to construct your own collection at some point, I'll demonstrate the Countable, ArrayAccess, and Traversable interfaces.
    42. Simple Real-Time Search Highlighting

      If you visit any lesson at Laracasts that includes a transcript, you'll notice searching for any string will highlight every occurrence of the word. In this Larabit, I'll show you how to add something similar in your own projects. It's really very simple.For this example, we'll create a Vue component that renders the lyrics to a song. We'll then add a search box to highlight all matching queries.
    43. Introduce Seams for Better Refactoring

      In this video, you'll learn how to introduce seams. This is one of my favorite refactoring techniques - particularly when cleaning up large, messy methods. It's a simple enough process that involves adding a conditional to the top of the method you're refactoring. This then gives you a "hook" for introducing and rewriting portions of the code, while still having the option to fall back to the original logic and implementation.With this approach, you can incrementally refactor your code in bits and pieces.
    44. Consider Interaction Traits for Tests

      In this Larabit, I'll give you some basic tips and advice for extracting "interaction" traits for your tests. This is a very simple pattern, but one that provides a lot of bang for your buck. In fact, you'll find it in the Laravel codebase all over the place.
    45. Refactor to Match Expressions

      In this Larabit, I'll show you how to refactor a series of confusing PHP conditionals into a simple lookup table. To accomplish this, we'll leverage PHP 8's match expression and its ability to handle non identity checks. As we work on this refactor, we'll also talk briefly about the strategy pattern, and how to extract a factory method to build up the appropriate object. I think you'll enjoy it!
    46. So Much Power in a Single Line

      Laravel's authorization gates are wildly powerful and flexible thanks to their integration with the rest of the framework. Once you write a single line of code to define a new gate, you can then "perform" this authorization within your controllers, or as a middleware, or even as a Blade or PHP conditional in your views.In this Larabit, we'll use the common example of an admin section that should be exclusive to a select few people on a website. We'll then write one line of authorization logic to declare who may access this section.
    47. New in Laravel: Disable Lazy Loading

      One side-effect to Eloquent's ability to lazy load relationships on the fly is the fact that it occurs behind the scenes. It's not always easy to spot. If you're not thoughtful and careful, this can often lead to the undesirable N+1 problem. Or, in other words, if you fetch one hundred records from the database, you end up with one hundred SQL queries.Laravel 8 now supports a sort of "strict" mode for lazy loading. When turned on, it disallows it entirely. Instead, an exception will be thrown when your application attempts to lazy load an Eloquent relationship. Let me show you how it works in this Larabit.
    48. Exciting New PHP 8.1 Features

      PHP 8.1 is scheduled to be released near the end of 2021, and it's shaping up to be another fantastic release. You can look forward to a variety of useful features ranging from constructor initializers, to read-only class properties, to enum support.
    49. How Jeffrey Would Setup PHPStorm

      I'm asked about which code editor theme I use frequently enough to the point of being comical. It's called Nord, by the way.

Continue Learning