Laravel 8.47, weekly updates, and 🔥 tip

Laravel 8.47

A few new additions this week brings us to version 8.47. Here are the highlights:

  • Add "scoped instances" to the container in #37521
  • Add whereContains JSON assertion in #37631
  • Add Str::match and Str::matchAll in #37642
  • Allow tap on Paginator in #37682

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 some Human Shifts. I have a few more which came in yesterday. These have kept me busy. So I'm still trying to prepare the secret project for its initial release.

In case you missed it, I announced the secret project - it's a desktop app of the Workbench. More technically an Electron app, powered by Docker, which allows you to run many Shift tasks locally.

You may view the tweet thread for the full backstory. tl;dr; I feel the Workbench is an under-utilized tool because it needs to be readily available to developers on their local system. I hope to launch an early release next week.

In the meantime, Jess has been working on some additional tasks. These relate closely to the BaseCode practices, such as removing dead code, using early returns, as well as removing comments or converting docblocks to type hints.

While I could call YAGNI on these for the initial release, they've been pretty cool to build. Plus these pave the way for building more Workbench tasks. Which helps us quickly create more as we receive feedback after launch.

This week my goal is to finish up the distribution for the Workbench, and hopefully do a live stream later in the week to share more about building this desktop app.

🔥 Tip

In working on these tasks, I noticed areas of my code that do not honor the BaseCode practices. Specifically some dead code and code comments that are generated by artisan make commands.

Of course artisan make is meant for education as much as it is code generation. Furthermore, you may customize the stubs to remove this code. So, this is not an issue with artisan. More on myself for not being thorough in cleaning up.

One example of dead code I find in many classes is an empty constructor.

1public function __construct()
2{
3 parent::__construct();
4}

Or simple docblocks that are now second nature after using Laravel for so many years.

1/**
2 * Execute the console command.
3 *
4 * @return int
5 */
6public function handle()
7{
8 // ...
9}

We may remove this code. Doing so often cuts the initial code in half, streamlining the class significantly. Both of these are automated by the new tasks I talked about above. 🔥