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

Browse all series

Luke's Larabits

Here, you'll find Luke Downing'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
32
Run Time
6h 15m
Difficulty
Intermediate
Last Updated
Oct 14, 2024
Version
Latest

Series Episodes

  1. Episodes (31)
    1. Finally, a Great Way to Blog with Markdown!

      As all developers do, I'm upgrading my blog. It's going great, but… well, I'm struggling with the blogging part. See, most blogging platforms just don't suit my needs - too powerful, not Laravel, or outdated. Do I really have to roll my own solution for this? No! Turns out there's a new kid on the block that might just solve all our woes. Meet Prezet!
    2. Pest's Stressless Stress Testing

      Have you ever wanted to measure the performance impact of changes to your application? Or maybe you want to verify that your $5 Digital Ocean droplet can satisfy your first million users? Pest's Stressless plugin provides a simple API to quickly give you all the insight you'll need to deploy with confidence. Let's take a look at an example.
    3. Take the Time to Explore

      The tools we use are often a black box - we know they work, but how or why is anybody's guess! For example, how on earth does Herd provide dump and dd functions outside of Laravel? With a little exploration, we can figure it out! We might even learn a thing or two about PHP we didn't know before. Grab your map and compass, it's time to explore.
    4. Unwrapping Pest 3

      At Laracon US, Nuno announced the release of the latest version of Pest PHP - version 3! It includes an array of exciting new features: a nicer configuration API, team management, architectural presets and first-party mutation testing. Let's take a look at each of these so that you can start using them with confidence in your projects!
    5. Here's What You Missed at Laracon

      I'm back from speaking at Laracon US 2024! There was a real buildup of excitement for this Laracon, and it did not disappoint. In fact, it marked a pivotal point in history for our little framework. Let me tell you about the standout moments of the conference.
    6. Cache Timeouts You Can Actually Understand

      When you use Laravel's Cache class or facade, you also define a ttl, or time-to-live, that determines how long that item will remain cached for. You may have used a plain integer for this in the past. I'd like to show you a far better approach that will make your code easier to read and maintain.
    7. Dive Deeper with Actions

      In Jeffrey's recent Larabit, he discussed the intermediate trap and how you can use actions to keep code clean and understandable. You know, I'm something of an action man myself, so I'd like to take it one step further. Strap in, it's time for Action-ception.
    8. Here's How I Format Headlines in Laravel

      Headlines and titles appear in almost every app you build. If you want to enforce a certain case for displaying them, Laravel gives you a few different options. However, I think one stands out above the rest and in this bit I'll show you why.
    9. Watch Me Submit a Laravel Pull Request

      In a recent series of mine, we tackled a complex contribution to Open Source. However, more often that not your contributions will be far smaller in scope - perhaps just changing an existing method. Together, let's create a PR to Laravel that will only take us 10 minutes to put together.
    10. Str::markdown() is More Powerful Than You Think

      You likely know that Laravel's Str::markdown() method allows you to effortlessly convert markdown to HTML, but did you know that you can just as easily extend it with some crazy powerful features? Let me show you three cool examples to get you started.
    11. Pruning Your Eloquent Models

      Every application eventually needs pruning - the act of cleaning up outdated database records. You may have created a custom script in the past, but Laravel actually provides an out-of-the-box solution using the model:prune command. Let's take a look at an example together.
    12. How to Perform Random Order Pagination

      Have you ever wanted to use inRandomOrder and paginate together in one Eloquent query? They seem to cancel each other out, right? Thankfully, it is actually possible to fix this by leveraging seeds, but there are a few caveats. Let's have a look together.
    13. Automate Vite with PhpStorm

      Sick and tired of forgetting to run npm run dev every time you open your project? Me too! If you're using PHPStorm, it's trivial to instruct the IDE to run that script automatically. I'll show you how!
    14. A Byte-sized Bitwise Primer

      As a self-taught developer, I avoided binary and bitwise operations for the longest time. In hindsight, I wish I hadn't, as even a basic understanding of bitwise operations can help explain how the computers we use every day function. In this Larabit, we'll inspect just one bitwise operator together.
    15. Exploring Laravel Reverb

      Alongside Laravel 11, the team released Reverb: a websocket server written in PHP. This makes it a cinch to send real-time events from server to client. Don't believe me? Let's play around with Reverb and see just how simple it is to get started.
    16. What's New in Vue 3.4

      The Vue team recently released version 3.4 of the framework. It contains two key features that will greatly simplify a lot of component logic you've had to write in the past. Let's get you up to speed!
    17. Exploring PHP's Spaceship Operator

      No, we're not talking about astronauts here! The spaceship operator in PHP allows you to drastically simplify sorting logic when dealing with complex data structures, such as multidimensional arrays. Let me show you how to use it in this Larabit.
    18. Setting Up a Mac for Laravel in 2024

      I recently purchased a new MacBook. Impressed as I was, I was equally amazed by how easy it has become to set up a development environment for Laravel. Let me show you the steps I took to go from a blank machine to a clutter-free programming environment.
    19. Laravel Pulse First Look

      Laravel recently released Pulse, a lightweight monitoring tool designed to give you quick and useful insights into the health of your Laravel applications. I'd like to see what it provides us out of the box, so let's, together, take it for a spin.
    20. Laravel Prompts First Look

      Everybody knows the CLI is ugly, right? Not anymore! Laravel prompts is a framework agnostic package for gorgeous input in CLI applications. I have an Artisan command I've been wanting to add dynamic input to for a while, so join me as I explore what Laravel Prompts offers.
    21. Strict Types by Example

      Have you ever wondered what declare(strict_types=1) actually does when you include it at the top of a PHP file? Let's take a look at a couple of examples and discuss the pros and cons of enabling it in your applications.
    22. From Blank to Blog With Laravel in 10 Minutes

      Ever wondered what Laravel is all about? If you have 10 minutes, let's put together a simple blog with commenting functionality to get a feel for how Laravel works, and the toolkit provided right out of the box. I think you'll love it!
    23. An Intro to Container Queries

      Responsive web design has been around for years now, but it was always limited by the fact that you could only really alter styles based on the browser viewport. That changed with CSS Container Queries, and if you haven't heard of them, you're missing out. Let me introduce the two of you.
    24. Refactoring to First Class Callables

      First Class Callables were first introduced in PHP 8.1, but they're still quite rare to see in the wild. If you know how to use them, they actually allow for some very clean refactoring, especially when working with Collections. Let me show you an example!
    25. 5 Excellent New Features in Pest v2

      Pest 2.9 brings along with it a handful of spicy new features, from snapshots to type coverage to improved architecture testing. Let's cover how you can get started with all of them! In this Larabit, we'll review five new features that you can start using...now!
    26. Laravel Volt First Look

      Livewire 3 ships with a shiny new plugin called Volt, allowing us to create single file components using simple functions! If you're already familiar with Livewire, it's a breeze to get to grips with Volt. Let's build a registration form together to get a feel for how it works.
    27. Livewire 3 Has Rekindled My Interest

      Livewire 3 is now in public beta, and the features on offer have me excited to start using it again! In this Larabit, I will show you why I think Livewire 3 is a particularly outstanding upgrade that makes web development delightful and fun.
    28. Don't Sleep on the Sleep Helper

      Laravel recently introduced a handy new Sleep class that serves as a drop-in replacement for PHP's sleep and usleep functions. Why would you want a wrapper around such simple functions? Let me show you!
    29. Convert a Project From Laravel Mix to Vite

      It's been a little while since Laravel switched to Vite as it's default asset bundler. You might still have projects using Mix, perhaps because you're worried it will take an age to migrate, or that everything will break. However, the reality is that migrating to Vite only takes a few minutes and is well worth the effort. Let's look at what changes are required.
    30. How to Create a Pest Plugin

      Find yourself reusing the same custom helpers across all your Pest projects? Want to add something to Pest's output or hook into different parts of the test lifecycle? You can do that! Let's look at how to create a Pest plugin in this Larabit.
    31. A Quick Guide to Pest

      So, you want to jump into the world of testing? Or perhaps you're a seasoned PHPUnit dev but want to see what Pest has to offer? Let's take a quick look at how you can install and configure Pest in your next or current project!

Continue Learning