Shift with red gradient lettering

Adopt if helpers

Premium
Laravel
Experimental

Collapse multiline if statements by adopting Laravel's abort_if and throw_if helpers.

Before

if ($failed) {
abort(422, 'Validation failed');
}
 
if (!isset($parameter)) {
throw new \InvalidArgumentException('Missing required parameter');
}

After

abort_if($failed, 422, 'Validation failed');
 
throw_if(!isset($parameter), new \InvalidArgumentException('Missing required parameter'));

← 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.