Laravel 8.23, weekly updates, and 🔥 tip

Laravel 8.23

Few new additions this week, with a fast follow patch release. So we get bumped to 8.23.1.

Also, there was a security patch last week, so you should definitely bump your version constraints (if this wasn't automated for you by Shift already).

Highlights from 8.23:

  • Limit expected bindings in #35865
  • Allow a specific seeder to be used in tests in #35864
  • Add default parameter to throw_if and throw_unless in #35890
  • Throw ModelNotFoundException for sole in Eloquent in #35902
  • Pass $key to reduce closure for Collection and LazyCollection in #35878
  • Add validation support for TeamSpeak3 URI scheme in #35933

You may review the full branch diff on GitHub for a complete list of changes.

This minor version bump and update is automated for subscribers to a Shifty Plan. If you don't have one of those, be sure to bump your constraint and run composer update to get the latest features.

Weekly Journal

Last week I finished up the remaining Dusk tests. Most of them dealt with handling Stripe Elements. I found this post to guide me through this, just needed to modernize a few references. I also leveraged assertSeeIn instead of low-level WebElement selectors.

All the remaining "facelift" items were completed. I updated the filtering UX on the Shifts page from a first-time user perspective. These now give a clearer path of how to upgrade older apps by breaking the Shifts into "Start with", "Next run", and "Optionally run" sections.

I also had a few Human Shifts. I upgraded one app from Laravel 5.1 to 8.x in under 10 hours. I'm told that has been pushed to production and is running smoothly. The other was from Laravel 5.6 to 8.x in about 4 hours. We'll be reviewing that Thursday.

This week I have a few final tweaks I want to make to the website. Then both Jess and I are going to switch gears to the Shift "engine" and focus on writing the Tailwind 1.x Shift and Tailwind 2.x Shift.

I'm also going to finish Laravel Secrets which I picked up a copy of on launch day. As well as finish setting up Ray. Which I wanted to call Beam when Freek gave me a sneak peak earlier this month.

🔥 Tip

I touched upon this before, but since Dusk runs the application and tests separately you may run into a few gotchas. For example, I was using the DatabaseTransactions trait in an effort to reset the database changes from each test case. However, this and the RefreshDatabase trait are unusable with Dusk.

Instead, you may use the DatabaseMigrations. I found this to significantly slow down my tests. So I simply removed it and allowed my Dusk tests to accumulate records in the database for each run. This does increase the chance of "test pollution" - where remnants from a previous test fail another test. But I am comfortable with that trade-off as it keeps the tests fast and exposes potential overlap in test cases.