Weave Code
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 Countries Laravel Package

drnd-dev/laravel-countries

View on GitHub
Deep Wiki
Context7

Basic Usage

To import Country::class, use the following code:

use Lwwcas\LaravelCountries\Models\Country;

Country::all();

To import CountryRegion::class, use the following code:

use Lwwcas\LaravelCountries\Models\CountryRegion;

CountryRegion::all();

List of Countries

This is the easiest and most straightforward way to get a list of countries.

Whether you need country names, codes, or even their flags, this method provides it all in a simple and efficient way. It’s perfect for quickly accessing country information without any hassle.

::: tip If you liked this simple version, you definitely need to check out the Full version of the country list! There's so much more you can do more details, more options, and even deeper customizations to fit all your needs. :::

ID and Name

Offers a list of countries with IDs associated with their translated names. Useful for quickly fetching country names based on their IDs.

::: code-group

use Lwwcas\LaravelCountries\Models\Country;

Country::getList()->idAndName();
Illuminate\Support\Collection {
  items: array:245 [▼
    248 => "Afghanistan"
    260 => "Åland Islands"
    251 => "Albania"
    305 => "Algeria"
    256 => "American Samoa"
    246 => "Andorra"
    253 => "Angola"
    250 => "Anguilla"
    254 => "Antarctica"
    ...

:::

Alpha-2 and Name

Offers a list mapping ISO Alpha-2 codes to Names.

::: code-group

use Lwwcas\LaravelCountries\Models\Country;

Country::getList()->alpha2AndName();
Illuminate\Support\Collection {
  items: array:245 [▼
    "AF" => "Afghanistan"
    "AX" => "Åland Islands"
    "AL" => "Albania"
    "DZ" => "Algeria"
    "AS" => "American Samoa"
    "AD" => "Andorra"
    "AO" => "Angola"
    "AI" => "Anguilla"
    "AQ" => "Antarctica"
    ...

:::

Only Emoji in Img

Returns a list of emojis img.

::: code-group

use Lwwcas\LaravelCountries\Models\Country;

Country::getList()->onlyEmojiInImg();
Illuminate\Support\Collection {
  items: array:245 [▼
    0 => "🇦🇫"
    1 => "🇦🇽"
    2 => "🇦🇱"
    3 => "🇩🇿"
    4 => "🇦🇸"
    5 => "🇦🇩"
    6 => "🇦🇴"
    7 => "🇦🇮"
    8 => "🇦🇶"
    9 => "🇦🇬"
    ...
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.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope