Shift with red gradient lettering

optional to nullsafe

Laravel
PHP 8

Convert calls to Laravel's optional helper within your application to use the nullsafe operator (?) newly available starting in PHP 8.0. Any calls passing a second callback argument will not be converted.

Before

optional($user->address)->street;

After

$user->address?->street;

← Back to the Workbench Tasks

Sign in with any of the following services to connect Shift with your Laravel project.


Don't use one of these services?

Temporarily push your project to a free, private repository on one of these cloud-based services or upgrade your project locally with Shift for Docker.