๐ฉโ๐ป Join our community of thousands of amazing developers!
In PHP 7.4 a widely requested feature landed: arrow function. In this blogpost I'd like to show you how I like to use them. Let's start with an example from the Oh Dear codebase I tweeted out a few days ago. In Laravel 6 and PHP 7.3 you could do this: public static function boot() { static::boot(); static::creating( function (Team $team) { return $team->webhook_signing_secret = Str::random(32); } ); } In Laravel 7 and PHP 7.4 you can rewrite it to this:...