A Better Database Testing Workflow in Laravel

Out of the box, Laravel provides two traits for helping you work with the database in your tests.

In this screencast, I walk through the pain points of each, and introduce an alternative approach that can give you the best of both worlds.

You can check out the DatabaseSetup trait from the screencast in this gist.

Trying to wrap your head around testing? Test-Driven Laravel is a course I recently launched that teaches you how to TDD an app from start to finish. Learn more about it here.