PHP 8, Laravel 8 and Vue 3

🐘 PHP 8
PHP 8 will be released on November 26, 2020. It’s a new major version with some breaking changes and a lot of new features. The most interesting are:
Union types
A new way to type params and outputs.
public function foo(Foo|Bar $input): int|float;JIT
Just-in-time acronym. It’s a new compiler that promises significant performance improvements specially when we are not in a web request context, but not only.
Nullsafe operator
This will change your code a lot avoiding to make intermediate checks or using optional functions like the one that Laravel provide.
// This
$dateAsString = $startDate ? $startDate->asDateTimeString() : null;
// Will become
$dateAsString = $booking->getStartDate()?->asDateTimeString();Named arguments
This will also be a big improvement in how we call our functions and send params. In PHP 8.0 we can specify the param we are passing, so we can send them in the order we prefer.
function foo(string $a, string $b, ?string $c = null)
{ /* … */ }
foo(
b: 'value b',
a: 'value a',
);There more interesting features coming. You can find all of them here or, in Spanish, if you prefer.
🖼 Laravel 8
Laravel 8 was released a few days a go with Laravel Jetstream, a new dedicated directory for models (some people will love this), a new entirely re-written model factory, Job batching and more.
Laravel Jetstream is a new scaffolding for Laravel that provides a starting points with users, 2FA, session management, teams and more. It will save you a lot of time for prototyping your project.
More
🖖🏻 Vue.js v3 was released. Now it’s smaller, faster and equipped with better TypeScript support. Also, it has Composition API built-in, multiple root elements and even more.
Please, share this with your mates and other PHP developers.

