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 Countries Scopes

Scopes in Laravel allow you to reuse query logic efficiently.

The whereSlug() method shown here simplifies filtering countries by their slug.

This scope is especially useful when you need to filter and find countries based on their slugs.

It keeps your queries cleaner and reusable across your project.

Where Name

The name field allows you to search for a country in any translation, ensuring the correct country is always found regardless of the language used.

use Lwwcas\LaravelCountries\Models\Country;

Country::whereName('United Kingdom')->first();

Where Slug

The slug field is a URL-friendly version of the country name, typically generated by converting the country name into lowercase, replacing spaces with hyphens, and removing special characters.

This allows for easier search and filtering in URLs.

use Lwwcas\LaravelCountries\Models\Country;

Country::whereSlug('spain')->first();

Where Oficial Name

The official_name field contains the formal or official name of the country as recognized internationally. It is typically used in official documents and formal contexts.

use Lwwcas\LaravelCountries\Models\Country;

Country::whereOficialName('Republic of Bulgaria')->first();

Where Uid

The uid field is a unique identifier (ULID) assigned to each country. It ensures that every country record has a globally unique and secure identifier that is not easily predictable, making it ideal for distributed systems and ensuring data integrity across various systems.

use Lwwcas\LaravelCountries\Models\Country;

Country::whereUid('01J95Z30PMTMAQC8X1S4Y5SRYY')->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