Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Country Flags

Laravel Country Flags Laravel Package

stidges/laravel-country-flags

Laravel package that renders country flags from ISO country codes, with handy Blade directives and helpers for displaying flag icons in your views.

View on GitHub
Deep Wiki
Context7

A Laravel wrapper for the stidges/country-flags package

Frequently asked questions about Laravel Country Flags
How do I install stidges/laravel-country-flags in a Laravel app?
Install it with Composer using a pinned constraint such as composer require stidges/laravel-country-flags:^3.0.1. Laravel package auto-discovery should register the service provider automatically, and any config or flag assets can be published if the package provides publishable resources. Commit any published assets so deployments stay deterministic, then render a flag in a Blade view to verify the setup.
Does stidges/laravel-country-flags support Laravel 12?
Yes. The v3.0.1 patch release specifically adds Laravel 12.x compatibility, so it is the version to use if Laravel 12 support is what you need. Because that compatibility work landed in the patch line, pin to ^3.0.1 rather than ^3.0. Confirm the exact PHP and Laravel constraints in the package composer.json before rolling it out.
Which Laravel versions does v3.x of stidges/laravel-country-flags support?
v3.0.1 adds Laravel 12.x support, but the v3.0.0 major release may have raised the minimum supported Laravel and PHP versions. Check the composer.json constraints and the CI matrix to confirm whether Laravel 10 and 11 are still covered on your current version. If you are running older Laravel releases, verify compatibility before assuming a drop-in upgrade.
How do I show a country flag in a Blade view with this package?
The package is designed for presentation-layer use, so you render flags from ISO 3166-1 alpha-2 country codes directly inside Blade templates using its directives or helpers. For maintainability, wrap the vendor call in your own Blade component such as <x-country-flag :code="$country" /> so templates never reference the package API directly. That keeps a future swap to an internal sprite sheet or another package cheap.
Does stidges/laravel-country-flags provide both a Blade directive and a PHP API?
The package is a Laravel wrapper around stidges/country-flags and is intended for Blade-level display of flag icons. Confirm in the installed version whether it exposes a Blade directive, a Blade component, a PHP helper, or a combination of these. If you need to generate flags outside views, verify the PHP API first and wrap it behind your own helper.
Are flag images bundled with the package or loaded from a CDN?
The asset delivery model matters for offline availability, Content Security Policy rules, cache headers, and GDPR exposure from third-party requests. Confirm whether flags ship as bundled SVG or PNG files that can be published to public/ or whether they are fetched from a remote host at render time. If assets are bundled, commit the published files; if they are remote, review CSP and privacy implications before adopting.
Is stidges/laravel-country-flags safe to use in production?
Technically the risk is low: it is a small, leaf-level presentation utility with no database, queue, or external service dependency. The main caveat is maintenance concentration, since it is a single-maintainer package without a formal support commitment. Pin to ^3.0.1, keep usage confined to views and view models, and wrap it so you can replace it if needed.
How do I upgrade stidges/laravel-country-flags from v2 to v3?
Treat v3 as a major-version upgrade rather than a patch: read the v3.0.0 changelog and upgrade guide first and expect possible namespace, config, or API changes. Budget roughly half a day to a day to sweep existing flag call sites across your codebase. Update your constraint to ^3.0.1 so you also get the Laravel 12 compatibility patch.
Does stidges/laravel-country-flags cover territories, subdivisions, and deprecated country codes?
The package maps ISO 3166-1 alpha-2 country codes to flag assets, so its coverage depends on the underlying flag set it ships. Non-country territories, subdivisions, and deprecated codes may not be represented, especially edge cases. Verify that every code your address forms, locale switcher, or shipping selector actually uses is supported before committing.
What are the alternatives to stidges/laravel-country-flags?
Common alternatives are maintaining your own SVG sprite sheet, using a generic flag icon set in your asset pipeline, or choosing another actively maintained flag package. Because this package is presentation-only, it is easy to isolate behind a small internal Blade component. That wrapper means switching to an internal icon pipeline or a different package later is a localized change rather than a codebase-wide refactor.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource