Shift with red gradient lettering

Request data access

Premium
Laravel

Ensure your application accesses request data consistently using one of Laravel's common conventions.

Before

public function store(Request $request)
{
return User::create([
'first_name' => $request->'first_name',
'last_name' => $request->get('last_name'),
'email' => request('email'),
]);
}

After
(Access: Object, Method: input)

public function store(Request $request)
{
return User::create([
'first_name' => $request->input('first_name'),
'last_name' => $request->input('last_name'),
'email' => $request->input('email'),
]);
}

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