In this lesson, we will create a Livewire component for creating and editing orders. We will reuse some logic from before lessons, like select2 component or Pikaday, so not everything new will be new here.

Again, let's start this lesson by creating the Livewire component, Route Model binding Order and we will add a frontend layout with hard-coded data. Next, as this is a new component we need to register a route for it and make the Create and Edit buttons work. Also, to bind the input to the $order property we need validation rules, so let's also add them now...
Everything fine but EDIT order.
I keep getting an error: > A non-numeric value encountered
in the render function view line:
Creating is working fine. I have dd() for checking no nulls and everything is ok and also checked the table in MySQL.
Any ideas, please?
Hard to "blindly" debug it for you, any of those three variables could be "non-numeric" technically. Could you
var_dump()all of those separately and see the values?I understand, of course. I have dd(productPrice) inside OrderForm.php and when creating it returns the product value of 44 as 4400 but when I try to edit that order, it returns an array with dots and commas, as "4,400.00". I think I will have to check if isNumeric and if it is not convert it all the time. By the way, here in Spain, using Euros, I usually put the price as float with 2 decimal number. I understood you advice to use integer and use the two last digits as decimals. In which way is this better, please?
Thanks in advance for your help and advice.
Technically speaking, dealing with money is even more complicated, I suggest you read this in-depth article: Dealing With Money in Laravel/PHP: Best Practices
Regarding that it comes with dots and commas, this is interesting, for some reason it didn't happen during my testing. If you are unable to debug it yourself, you could push your code to GitHub and invite me (username PovilasKorop), I may take a look but only in a week or so.
Everything fine but when EDIT order in all orders page. it show A non-numeric value encountered error
$this->order->subtotal += $orderProduct['product_price'] * $orderProduct['quantity'];
in render function
i download your code from github it works fine when i order two product then i try two edit from product list it shows the same error please check A non-numeric value encountered