Back Button Laravel

Build A Laravel App With TDD

It's time to take the techniques we learned in Laravel From Scratch, and put them to good use building your first real-world application. Together, we'll leverage TDD to create Birdboard: a minimal Basecamp-like project management app.

This series will give us a wide range of opportunities to pull up our sleeves and test our Laravel chops. As always, we start from scratch: laravel new birdboard.

Intermediate
Difficulty
19 episodes
3:41:48 hrs
Start Series

Build A Laravel App With TDD

It's time to take the techniques we learned in Laravel From Scratch, and put them to good use building your first real-world application. Together, we'll leverage TDD to create Birdboard: a minimal Basecamp-like project management app.

This series will give us a wide range of opportunities to pull up our sleeves and test our Laravel chops. As always, we start from scratch: laravel new birdboard.

  • Latest Episode: Sometimes Validation With Form Requests

  • Like this series? Share the love!

  • 01

    Episode 1 Run Time 2:31

    Let's begin by reviewing the application that we plan to build. We'll then finish up by installing Laravel and performing the first commit.

  • 02

    Episode 2 Run Time 12:48

    My hope is to demonstrate, as much as possible, my actual workflow when writing my own applications. With that in mind, let's begin with our first feature test.

  • 03

    Episode 3 Run Time 5:32

    We haven't yet written any request validation logic. As before, let's use a TDD approach for specifying each validation requirement.

  • 04

    Episode 4 Run Time 7:33

    We must next ensure that a user can visit any project page. Though we should start with a feature test, this episode will provide a nice opportunity to pause and drop down a level to a model test.

  • 05

    Episode 5 Run Time 11:17

    It's true that we can now create and persist projects to the database, but they aren't currently associated with any user. This isn't practical. To fix this, we'll write a test to confirm that the authenticated user is always assigned as the owner of any new project that is created during their session.

  • 06

    Episode 6 Run Time 11:39

    In this episode, we'll continue tweaking which projects are displayed to the user. We'll also begin implementing the appropriate page authorization.

  • 07

    Episode 7 Run Time 6:38

    We already have the necessary logic to persist new projects, however, we haven't yet created the "create project" page, itself. Let's take care of that quickly in this episode.

  • 08

    Episode 8 Run Time 8:19

    Before I begin writing CSS, we first need to set the stage. We'll begin by pulling in all necessary npm dependencies and configuring Tailwind compilation with Laravel Mix.

  • 09

    Episode 9 Run Time 16:39

    In this episode, we'll leverage Tailwind to begin constructing the Birdboard UI.

  • 10

    Episode 10 Run Time 16:56

    Let's continue working on the CSS for the projects dashboard. This will give us an opportunity to discuss grid spacing, and how we can use a combination of padding and negative margins to perfectly align our columns.

  • 11

    Episode 11 Run Time 12:20

    Before we jump back to PHP, let's write one more lesson's worth of CSS. Specifically, we'll get the single project page up and running.

  • 12

    Episode 12 Run Time 15:24

    We've added a section to our project page for tasks, but that functionality doesn't yet exist. It sounds like we have our next step.

    View the source code for this episode on GitHub.

  • 13

    Episode 13 Run Time 9:11

    The next step is to update your project page UI to allow for displaying and adding new tasks.

  • 14

    Episode 14 Run Time 18:31

    In this episode, we'll wrap every task within a form so that we may easily update its description or completion status with the click of a button.

    View the source code for this episode on GitHub.

  • 15

    Episode 15 Run Time 5:05

    I'd like to sort all projects in our dashboard according to those that have been most recently updated. This means, when you add or modify a task within a project, we need to touch the parent project's updated_at timestamp in the process. Let's learn how in this episode.

    View the source code for this episode on GitHub.

  • 16

    Episode 16 Run Time 18:04

    Next up, we need to make the "General Notes" section of the project page dynamic. As always, we'll use tests to drive this new update. When finished, we'll also switch over to using dedicated authorization policy classes.

    View the source code for this episode on GitHub.

  • 17

    Episode 17 Run Time 16:35

    Let's take a moment to improve the structure of our tests. Have you noticed that, time and time again, we follow a similar pattern when arranging the world for a test? Instead, let's refactor this code into a fluent factory class to save time. To do this, we'll use a technique that I first learned from John Bonaccorsi in his Tidy up Your Tests with Class-Based Model Factories article. I encourage you to give it a read if you'd like to learn more.

    View the source code for this episode on GitHub.

  • 18

    Episode 18 Run Time 14:06

    In this lesson, we'll add a form to update an existing project. But in the process, we'll review how to reduce duplication in the create and edit views by extracting a reusable partial.

    View the source code for this episode on GitHub.

  • 19

    Episode 19 Run Time 12:40

    We'll begin this episode by addressing a small regression that was introduced in the previous episode: we can no longer update the general notes without triggering a validation error. While of course we'll review the easy solution to this issue, we'll additionally discuss a recent user comment related to the pros and cons of extracting a form request class. Would it make the code cleaner or better? You can look forward to lots of fun tips in this episode.

    View the source code for this episode on GitHub.

*Series still in development. Check back often for updates.