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

Workflow

Usage

To start using CountryGeographical::class, just add this to your code:

use Lwwcas\LaravelCountries\Models\CountryGeographical;

$geo = CountryGeographical::inRandomOrder()->first();
$geo->getGeoData();

Usage With a Country

The CountryGeographical data is designed to be seamlessly integrated with country-specific information.

use Lwwcas\LaravelCountries\Models\Country;

$country = Country::inRandomOrder()->first();
$geo = $country->geographical()->first();

$geoData = $geo->getGeoData();

or directly

use Lwwcas\LaravelCountries\Models\Country;

$country = Country::inRandomOrder()->first();
$geoData = $country->getGeoData();

Adding CountryGeographical to Queries

In Laravel, you can easily include the geographical information of a country by leveraging the with() method when querying countries. This allows you to load the CountryGeographical data alongside the country model, providing access to region codes, time zones, and other geographical properties.

Example Usage

To retrieve a country along with its geographical data, simply use the following query:

$country = Country::with('geographical')->find($id);
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