Level 2
Hi matttonks11,
The easiest way I know of for that is to write :
$request->merge(['key' => value]);
I hope it help !
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
When making a post request to store some data, I'm using a Request object to validate the data first before it hits the store method on my controller.
I was wondering is there a simple way to add an extra piece of data to the request object so it's available when the validated data hits the controller?
Hi matttonks11,
The easiest way I know of for that is to write :
$request->merge(['key' => value]);
I hope it help !
Please or to participate in this conversation.