Support the ongoing development of Laravel.io →
Requests Input

I have one middleware, which merges customerId to each incoming request.

if ( ! $request->has('customerId')) {
    $request->merge(['customerId' => auth()->user()->userId]);
}

When I'm fetching all input data using $request->all(), It's just works fine. If $request is of type Illuminate\Http\Request.

But if $request is of type App\Http\Requests then I can't get customerId while fetching all data using $request->all().

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

rjchauhan rjchauhan Joined 11 Jun 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.