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

Facade

The FlagEmoji facade is designed to enable you to interact with flag emoji attributes independently from the broader country data.

It uses a collection of flag emoji attributes, allowing you to retrieve, manipulate, and access specific emoji information in various formats (e.g., UTF-8, CSS, hexadecimal, etc.).

This is particularly useful for displaying flags or performing operations on flag emojis without dealing with the entire country dataset.

::: tip And all the methods you can see on the Emoji page :::

Usage

You can easily initialize the FlagEmoji facade by passing a single flag's attributes or a collection of them:

use Lwwcas\LaravelCountries\Facades\FlagEmoji;

new FlagEmoji([
    "css" => "\\1F1F5\\1F1F9",
    "hex" => "🇵🇹",
    "img" => "🇵🇹",
    "html" => "🇵🇹",
    "utf8" => "🇵🇹",
    "uCode" => "U+1F1F5 U+1F1F9",
    "utf16" => "\\uD83C\\uDDF5\\uD83C\\uDDF9",
    "decimal" => "🇵🇹",
    "shortcode" => ":flag-pt:"
]);

You can also pass a collection of flag attributes, which can be generated through a query result:

use Lwwcas\LaravelCountries\Facades\FlagEmoji;

$response = $country->withNamesSlugsAndFlags()->pluck('flag_emoji', 'uid');
return (new FlagEmoji($result));

Method Listing

Whether you're working with collections or individual flags, these methods ensure easy access and flexibility in handling flag emoji data.

Get

Retrieves a specific flag emoji attribute by key. If no key is provided, it returns all flag emoji attributes as a collection.

->get($flagKey = null)
$flagEmoji = new FlagEmoji($attributes);
$flagEmoji->get(); // Returns all attributes
$flagEmoji->get('css'); // Returns the CSS representation of the emoji

First

Returns the first flag emoji attribute from the collection.

->first()
$firstFlag = $flagEmoji->first();

Last

Retrieves the last flag emoji attribute from the collection.

->last()
$lastFlag = $flagEmoji->last();

Key

Returns the key of the current flag emoji.

->key()
$keyFlag = $flagEmoji->key();

keys

Returns a collection of the keys of all flag emoji attributes.

->keys()
$keysFlag = $flagEmoji->keys();
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