if($key == "postcode") {
$this->validate($request, [
'postcode' => ['required','regex:#^(GIR ?0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]([0-9ABEHMNPRV-Y])?)|[0-9][A-HJKPS-UW]) ?[0-9][ABD-HJLNP-UW-Z]{2})$#'],
]);
}
I need to convert the postcode field into uppercase before I pass it in to this validate function. I tried $request->input('postcode') = strtoupper($request->input('postcode')); but got;
Can't use method return value in write context.
I want to keep $request as the whole Request object ideally. Otherwise I’d just pass in the $request->input('postcode') on it's own. Actually I think the method is type-hinted for Request.
This is Laravel 5.1