From the top of my head, you can manipulate the data on the client side before the sumbit (using jQuery or whatever), and then submit the form using ajax.
Thanks for your reply. While that is indeed an option and it is probably the route I will end up going down if I can't find an appropriate solution on the server-side, I'd prefer to solve the issue using this class if possible.
Or take a look here, maybe it is the solution you want
https://laracasts.com/discuss/channels/general-discussion/laravel-5-modify-input-before-validation
formatInput()
has been removed :(
I've had a mess about with it though. Perhaps this could be a solution
public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
{
parent::initialize($query, $request, $attributes, $cookies, $files, $server, $content);
$this->getInputSource()->set('date_of_birth', '');
}
The merge method on the request object may work for you.
$request->merge(array('date_of_birth' => implode("-", [$request->year, $request->month, $request->day])));
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community