Forms\Components\TextInput::make('tva')->default(19)->live()->label('TVA')->suffix('%')->afterStateUpdated(function ($state, $get, $set) {// dd($get('products'));// if($state == 0) return; foreach ($get('products') as $key => $data) { $vat_val = (double)$state / 100; if (!$data['product'] && !$data['qty']) continue; $with_vat = $state == 0 ? 0 : $data['total_price_no_vat'] * (1 + $vat_val); $vat = $state == 0 ? 0 : $data['total_price_no_vat'] * $vat_val; $set("products.$key.total_price_vat", round($with_vat, 2)); $set("products.$key.total_vat", round($vat, 2)); } })->numeric(),