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

Method Listing

Below, you'll find a list of methods available in the Country model, along with friendly descriptions of what each method does. These methods are organized alphabetically for your convenience.

Order By Name

Sort countries by their name in either ascending or descending order.

->orderByName($sortMethod = 'asc')
Country::orderByName('asc')->get();

Where Area Km²

Find countries based on their area in square kilometers.

->whereAreaKm2()
Country::whereAreaKm2(500000)->get();

Where GDP

Filter countries by their Gross Domestic Product (GDP) in billions of USD.

->whereGdp()
Country::whereGdp(1000)->get();

Where Geoname

Find countries by their GeoNames ID. Use orWhereGeoname to add an OR condition to your query.

->whereGdp()

::: code-group

Country::whereGeoname(123456)->first();
Country::orWhereGeoname(789012)->first();

:::

Where Iso

Find countries by any ISO code (Alpha-2, Alpha-3, or Numeric). Use orWhereIso to add an OR condition.

->whereIso()

::: code-group

Country::whereIso('US')->first();
Country::orWhereIso('840')->first();
Country::orWhereIso('840')
    ->orWhereIso('BR')
    ->orWhereIso('PTR')
    ->orWhereIso('USA')
    ->orWhereIso('US')
    ->orWhereIso('120')
    ->get();

:::

Where Iso Alpha 2

Find countries by their ISO Alpha-2 code. Use orWhereIsoAlpha2 to add an OR condition.

->whereIsoAlpha2()

::: code-group

Country::whereIsoAlpha2('FR')->first();
Country::orWhereIsoAlpha2('DE')->first();

:::

Where Iso Alpha 3

Find countries by their ISO Alpha-3 code. Use orWhereIsoAlpha3 to add an OR condition.

->whereIsoAlpha3()

::: code-group

Country::whereIsoAlpha3('FRA')->first();
Country::orWhereIsoAlpha3('DEU')->first();

:::

Where Iso Numeric

Find countries by their ISO Numeric code. Use orWhereIsoNumeric to add an OR condition.

->whereIsoNumeric()

::: code-group

Country::whereIsoNumeric('250')->first();
Country::orWhereIsoNumeric('276')->first();

:::

Where Language

Find countries where a specific language is spoken.

->whereLanguage()
Country::whereLanguage('en')->get();

Find countries where all specified languages are spoken.

->whereLanguages()
Country::whereLanguages(['en', 'fr'])->get();

Where Name

Find countries by their name. Use orWhereName to add an OR condition.

->whereName()

::: code-group

Country::whereName('France')->first();
Country::orWhereName('Germany')->first();

:::

Find countries where the name matches a pattern. Use orWhereNameLike to add an OR condition.

::: code-group

Country::whereNameLike('United')->get();
Country::orWhereNameLike('Kingdom')->get();

:::

Where Official Name

Find countries by their official name. Use orWhereOfficialName to add an OR condition.

->whereOfficialName()

::: code-group

Country::whereOfficialName('Republic of India')->first();
Country::orWhereOfficialName('Commonwealth of Australia')->first();

:::

Find countries where the official name matches a pattern. Use orWhereOfficialNameLike to add an OR condition.

::: code-group

Country::whereOfficialNameLike('Republic')->get();
Country::orWhereOfficialNameLike('Kingdom')->get();

:::

Where Phone Code

Find countries by their international phone code. Use orWherePhoneCode to add an OR condition.

->wherePhoneCode()

::: code-group

Country::wherePhoneCode('+91')->first();
Country::orWherePhoneCode('+81')->first();

:::

Where Population

Find countries with a specific population.

->wherePopulation()
Country::wherePopulation(100000000)->get();

Where Slug

Find countries by their slug (a URL-friendly name). Use orWhereSlug to add an OR condition.

->whereSlug()

::: code-group

Country::whereSlug('france')->first();
Country::orWhereSlug('germany')->first();

:::

Where UID

Find countries by their unique identifier (UID). Use orWhereUid to add an OR condition.

->whereUid()

::: code-group

Country::whereUid('01ARZ3NDEKTSV4RRFFQ69G5FAV')->first();
Country::orWhereUid('01ARZ3NDEKTSV4RRFFQ69G5FAV')->first();

:::

Where WMO

Find countries by their WMO (World Meteorological Organization) code.

All three methods do the same thing.

->whereWmo()
->whereWmoCode()
->whereWorldMeteorologicalOrganizationCode()

::: code-group

Country::whereWmo('FR')->first();
Country::whereWmoCode('DE')->first();
Country::whereWorldMeteorologicalOrganizationCode('JP')->first();

:::

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
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