pelmered / filament-money-field

Money field powered by Money PHP
MIT License
40 stars 19 forks source link

Added fix for empty stings in a query (pelmered/filament-money-field#18) #23

Closed demianottema closed 3 months ago

demianottema commented 3 months ago

When the state is empty return null instead of a empty string. When returning a empty string the query will be like this:

SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect integer value: '' for column `laravel_2`.`products`.`price_discount` at row 1

update `products` SET `price_discount` = , `stock_tracking` = 0, `products`.`updated_at` = 2024-04-23 08:56:08 WHERE `id` = 2

After this fix it checks for empty strings and returns null instead so it gets filtered out of the query.