Shift with red gradient lettering

View data

Premium
Laravel

Ensure your application passes view data consistently using an array of key/value pairs.

Before

public function index(Request $request)
{
return view('user.index', compact('foo', 'bar'));
}

After

public function index(Request $request)
{
return view('user.index', [
'foo' => $foo,
'bar' => $bar,
]);
}

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