Public demo: nothing is sent to any provider and the data resets regularly.

Address form

Dependent dropdowns from the JSON routes of laravel-world (country, state, city) and, for Türkiye, from the provinces and districts that turkiye:seed wrote to the database. The postal code is validated for the chosen country with laravel-postcodes, and for Türkiye also against the province's plate code.

laravel-world laravel-turkiye laravel-postcodes
Try 34710 with İstanbul, 06420 with Ankara, sw1a1aa for the United Kingdom or 1234ab for the Netherlands.

Result

Submit the form to see the canonical postal code and the resolved names.

How it works

#[validate(required, PostalCode::from_field("country"))]
pub postal_code: String,

// Added in ValidatesRequest::rules when the country is TR:
rules.field("district", [Rule::custom(DistrictOfProvince::new("province"))])
     .field("postal_code", [Rule::custom(TurkishPostalCode::in_province("province"))])

JSON routes: /world/countries/{country}/states, /world/countries/{country}/states/{state}/cities, /address/provinces, /address/provinces/{il}/districts.

Özkan Özcan

Available for new projects

Hire the developer behind these packages

I am Özkan Özcan. I ported, tested and published every package in this demo, and I can do the same for your code:

  • Port your Laravel package or application to Laravel Rust
  • Move one slow service first and keep the rest in PHP
  • Priority support and custom features for any OzSuite package
Start a project See my services

I reply within one working day.