Level 51
You can modify the data in the request object before calling $request->all()
$request->merge(['preco' => str_replace('.', ',', $request->preco)]);
Model::create($request->all());
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello there! I'm brazilian, so my form has a field money type BR, and a I use comma. When I submit my form, I use str_replace('.', ',', $preco) but still I have problem to persist it in mysql whith Model::create($request->all()); . I use this way because I need take the ID saved. There are someone to help me?
Please or to participate in this conversation.