- Does artesaos/cidadesbr work with Laravel 10 or Laravel 11?
- The published package is from the Laravel 5.0/5.1 era with a last release dated 2015-07-15, so its Composer constraints and service provider conventions are likely incompatible with Laravel 10 or 11. Installing it as-is on a modern stack will probably fail dependency resolution or provider registration. You would need to fork it, bump the illuminate constraints, update the provider and PSR-4 setup, and test migrations and seeders on PHP 8.2+ before using it.
- How do I install artesaos/cidadesbr and seed the Brazilian states and cities?
- The intended flow is to require the package with Composer, run its migrations, and execute the bundled seeders so states and cities are inserted into your database. Because there is no documented config file, table names and seeder behavior come from the package itself, so review the migration and seeder code first. On a modern Laravel app, confirm the service provider registers cleanly and test the seeder for idempotency before running it in CI/CD.
- Is artesaos/cidadesbr still maintained?
- No, the repository shows a single release dated 2015-07-15, 53 stars, and no visible CI or tests. There is no indication of upstream fixes for Laravel compatibility, PHP 8 deprecations, or data updates. Treat it as abandoned and plan to fork and maintain it internally if you adopt it.
- What tables, models, and relationships does artesaos/cidadesbr add?
- It ships migrations for Brazilian states and cities plus Eloquent models and a state-to-cities relationship. Consumers query those models directly, and the overview notes convenient queries for cities by state or name. The package owns the schema and model namespace, and there is no visible abstraction layer, config file, or repository contract, so expect tight coupling to its table and column names.
- Can I filter cities by state or search cities by name with artesaos/cidadesbr?
- Yes, the package provides Eloquent models and query helpers for filtering cities by state and querying by name, which fits address forms and dependent select inputs. These queries run in PHP on the server, so you would expose your own controller or route if you need AJAX-driven city lists. It does not provide a JSON API, frontend bundle, search index, or data warehouse export.
- Does artesaos/cidadesbr use official IBGE codes as primary keys?
- The provided context does not confirm whether primary keys are the official IBGE state and municipality codes or surrogate auto-increment IDs. This matters because IBGE codes give free interoperability with freight, tax, and IBGE APIs, while surrogate IDs create a permanent mapping problem. Inspect the migrations before committing and check for unique indexes on any IBGE code columns.
- How do I use artesaos/cidadesbr in an address form or select input?
- Query the package's State and City models, pass the collections to your Blade view, and render them as select options; for dependent city selects, filter City by the selected state ID through your own endpoint. The package is Eloquent-only and server-rendered, so it suits Laravel forms and filters but not frontend autocomplete or mobile bundles without extra work. Also account for accent-heavy municipality names by ensuring utf8mb4 database defaults.
- How can I update or refresh the Brazilian city data in artesaos/cidadesbr?
- The package ships a frozen dataset and has no updater, external API call, or documented IBGE reference year in the provided context. Brazilian municipality data is relatively stable but does change, so frozen-2015 records may have gaps. To refresh it, fork the seeders and import current IBGE data, verifying record counts and whether the seeder uses updateOrCreate or upsert so reruns do not duplicate or truncate rows.
- What are the alternatives to artesaos/cidadesbr for Brazilian states and cities in Laravel?
- Alternatives include calling the IBGE API, maintaining an in-house states and cities dataset, or another Composer package that is actively maintained for your Laravel version. This package's advantage is that it needs no external API and works directly with Eloquent, but it is abandoned and schema-opinionated. If you need data outside PHP, such as frontend autocomplete, a search index, or a warehouse, prefer a source you can export and version yourself.
- Is artesaos/cidadesbr safe to use in production, and what about schema conflicts or licensing?
- Its security surface is low because it makes no network calls, has no auth, and handles no user input, but abandonment risk is high and there are no upstream fixes. Unprefixed states and cities tables commonly collide with existing address or ERP location tables, and the context does not confirm whether names are configurable. Verify the package license allows an internal fork and confirm the bundled IBGE data redistribution terms before production use.