TIPOFF / addresses

Laravel Package to manage addresses & interact with Address API
MIT License
0 stars 2 forks source link

SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'full_number' at row 1 #155

Closed phuclh closed 3 years ago

phuclh commented 3 years ago

When creating an address, got this error. Also, I selected a phone from the dropdown, it should not run the phone insertion query on the phones table.

Screen Shot 2021-05-01 at 9 52 14 AM
wolfrednicolas commented 3 years ago

@phuclh I'm checking this one as well, the problem looks like the var full_number is an object for this case

image

just before the firstOrCreate $full_number = $address->phone->full_number; $phone = Phone::firstOrCreate(['full_number' => $full_number, 'country_callingcode_id' => 1]);

it solved

phuclh commented 3 years ago

@wolfrednicolas One more thing, I don't think we need to create a phone when creating an address anymore because the PhoneNumber field already takes care of that.

wolfrednicolas commented 3 years ago

@wolfrednicolas One more thing, I don't think we need to create a phone when creating an address anymore because the PhoneNumber field already takes care of that.

I tested and you're right... let me remove those