In our laravel project they have used pragmarx/countries. I have postal code and country id but i need state_id also. So, I'm trying to integrate pragmarx/zipcode in my laravel project.
I have the following array: Array ([address] => kk nagar tamil nadu [country_id] => AU [postcode] => 625014 [city] => cedarvillage [price] => 45 [id] => 9 )
I referred: https://github.com/antonioribeiro/zipcode
and did in my controller, $zipcode = app()->make('PragmaRX\ZipCode\Contracts\ZipCode');
$zipcode_value = $zipcode->find($shipping['postcode']); //got $shipping['postcode'] from the above array.
Expected: To print the details related to zipcode
The error says, the postal code i have passed is of length 6. but it is expecting to pass it in length 8. How can i do this? Some of my postal codes are of length 6 only
I got the following error while printing $zipcode_value: PragmaRX\ZipCode\Support\Result Object ( [publicProperties:PragmaRX\ZipCode\Support\Result:private] => Array ( [success] => [errors] => Array ( [0] => Wrong zip length: in BR zip length is 8 not 6. ) ) [errors:protected] => Array ( ) )
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire