@php use App\Models\Customer; @endphp @php $customer = Customer::where('handphone', 'LIKE', "%'%")->get(); @endphp @foreach ($customer as $data)

{{ $data->handphone }}

@php $cleanedHandphone = str_replace("'", '', $data->handphone); if ($cleanedHandphone !== $data->handphone) { $data->handphone = $cleanedHandphone; $data->save(); echo "

Updated: {$cleanedHandphone}

"; } $update = Customer::where('id_customer', $data->id_customer)->update(['handphone' => $cleanedHandphone]); @endphp @endforeach