Laravel 8.74, weekly updates, and 🔥 tip

Laravel 8.74

Lots of new features this week, so we get a minor version bump to Laravel 8.74. Here are the highlights:

  • Add optional exclude parameter to model:prune in #39749
  • Add App::hasDebugModeEnabled() to detect debug mode in #39755
  • Add fakeExcept and fakeExceptFor methods to Event facade in #39752
  • Add aggregate to Eloquent passthru in #39772
  • Add undot to Arr and Collection classes in #39729
  • Add reverse to Str class in #39816
  • Ability to create fulltext indexes for MySQL in #39821
  • Optimize the execution time of the unique method in #39822

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

This 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 was my favorite holiday - Thanksgiving. Between all the families we celebrated four times. One of which I cooked myself. The turkey turned out great.

In between I completed one of the Human Shifts that came in. There's one more I'm finishing up this week.

I also continued to work on the PHP 8.1 tasks. Particularly the new in initializers. Jess is working on more tasks for PHP 8.1. I hope to release these later today. With that, the price will increase to $59. We're slowly working our way up to full price at $99.

Last Tuesday, Shift earned its 1 millionth dollar. I've been grinding it out for 6 years and finally reached $1,000,000 in revenue. I review the years, decisions, and personal struggles in this massive 7500 word post.

I wanted to share it with the newsletter first as a small way to say thanks for helping Shift reach this milestone. It took the better part of yesterday to proofread and finalize the post. Which is why this went out a day late.

🔥 Tip

In working on the new in initializers task, I learned a nuance of this feature - you may only use it with promoted properties.

For example, consider the following constructor:

1class Foo
2{
3 private $bar;
4 
5 public function __construct() {
6 $this->bar = new Bar();
7 }
8}

Could not become:

public function __construct($bar = new Bar()) {}

It would need to be:

1class Foo
2{
3 public function __construct(
4 private $bar = new Bar();
5 ) {}
6}

The new in initializers task will actually perform this two-step refactor for you by first running the Property Promotion task. So it will handle converting this example snippet. 🔥