guiliredu/laravel-seed-migration-estados-cidades-brasil
Laravel package that seeds all Brazilian states and cities into your database via ready-made migrations. Quickly populate IBGE state and municipality data for forms, address lookups, and location filters without manual imports or external APIs.
Architecture fit. This is a thin data-provisioning package rather than a functional library: it ships a migration and a seeder that create and populate estados and cidades tables with Brazilian geographic reference data (27 states, ~5,570 municipalities). Architecturally it is a "reference data" concern that most Brazilian-facing Laravel applications eventually need — address forms, shipping zones, tax jurisdiction lookups, customer segmentation. It introduces no service layer, no runtime dependency, no facade, and no code paths that execute outside of artisan migrate/db:seed. That makes it a low-blast-radius addition if the target application's address model is willing to adopt its schema, and a poor fit if it is not.
Integration feasibility. Mechanically trivial: composer require, publish or auto-load the migration/seeders, run migrations. The primary feasibility gate is Laravel version drift. The last release is November 2020, which places it in the Laravel 7/8 era. Migrations from that period generally still execute on Laravel 9/10/11, but auto-discovery, namespace conventions, and PHP 8.1+ deprecation behavior (implicit nullable parameters, dynamic properties) need to be validated, not assumed. If the target app is Laravel 10/11 on PHP 8.2+, treat this as "verify before commit."
Technical risk. Three risks dominate:
estados and cidades (Portuguese). Any existing address schema, or a competing package (e.g., a states/cities package), will conflict. There is no configuration for table names, key types, or column shapes. You adopt the package's opinion or you fork it.Key questions.
bigIncrements vs increments, UUID, soft deletes)? If so, the package's schema will need to be copied and adapted, not installed.Stack fit. Best fit is a conventional Laravel monolith or modular monolith with Eloquent, MySQL/Postgres, and a Brazilian user base. It is a poor fit for APIs that only need a handful of locations, for multi-tenant architectures where reference data must be per-tenant, or for stacks that already standardize on a states/cities abstraction. It is essentially irrelevant to non-Brazilian products.
Migration path. Two viable paths, chosen by whether the schema is acceptable:
database/migrations and database/seeders, then remove the Composer dependency. This eliminates the abandonment risk, allows table/column renaming to match existing conventions, and lets you replace the static seed with a refreshed IBGE-derived dataset later. The package becomes a one-time data source rather than a runtime dependency.Compatibility. Confirm three things in a sandbox before any application change: (1) the migration runs cleanly on the target Laravel and database versions; (2) PHP 8.2+ emits no deprecations during seed; (3) the seeder completes within the deployment window (full seeding can take tens of seconds to minutes depending on insert strategy). Check whether migrations are auto-loaded or published — this determines whether a fresh migrate on a new environment silently creates these tables, which may or may not be desired.
Sequencing.
Maintenance. Low ongoing effort — it is static reference data — but with a caveat: because the package is unmaintained, "low effort" only holds if you own the fork or have absorbed the data. If you keep it as a dependency, every Laravel major upgrade becomes a small risk event you must re-test. Assign explicit ownership of the reference dataset and a periodic (annual) IBGE reconciliation.
Support. Community-only, effectively none. There is no vendor, no SLA, no issue-triage commitment. Internal runbooks must document where the data came from, how to regenerate it, and how to add or rename a municipality if a business need arises.
Scaling. Negligible runtime cost — two small, read-mostly tables. The real cost is at seed time and in deployment pipelines: re-seeding on every deploy is wasteful and can cause lock contention or duplicate-key errors if not idempotent. Seed once, seed idempotently (updateOrCreate or truncate-and-insert), and keep it out of routine deploys.
Failure modes.
estados/cidades tables or with a competing geography package.Ramp-up. Near-zero for any Laravel developer — it is install, migrate, seed, query. The ramp-up cost is concentrated in the decision work (data validation, schema ownership), not the coding work. A TPM should budget roughly a day for the sandbox spike and data validation and treat the rest as routine integration. The headline recommendation: use it as a data source, absorb the migrations and seed into the application, and do not carry it as a long-term runtime dependency.
How can I help you explore Laravel packages today?