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

Emoji

This section lets you easily grab country flags as emojis! It's a fun and simple way to display flags in your projects, perfect for user interfaces or anywhere you need a quick, compact flag representation.

This is perfect for adding a fun and universal representation of countries in your project, whether it's for visual displays, user interfaces, or any context where a compact flag representation is needed.

Flag Emoji By

Returns the flag emoji based on the specified type.

->getFlagEmojiBy(string $type = 'img')
$country = Country::inRandomOrder()->first();

$country->getFlagEmojiBy(); // Get Img
$country->getFlagEmojiBy('img'); // Get Img
$country->getFlagEmojiBy('utf8'); // Get Utf8
$country->getFlagEmojiBy('utf16'); // Get Utf16
$country->getFlagEmojiBy('uCode'); // Get uCode
$country->getFlagEmojiBy('hex'); // Get Hex
$country->getFlagEmojiBy('html'); // Get Html
$country->getFlagEmojiBy('css'); // Get Css
$country->getFlagEmojiBy('decimal'); // Get Decimal
$country->getFlagEmojiBy('shortcode'); // Get Short Code

Flag Emoji Image

Returns the flag emoji

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

// all functions are the same and return the same value
$country->getFlagEmoji();
$country->getFlagEmojiImage();
$country->getFlagEmojiImg();

Output Html

Returns the flag emoji as an image wrapped in an HTML element.

->getFlagEmojiImgWithHtmlCode()

::: code-group

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

$country->getFlagEmojiImgWithHtmlCode();
<span>πŸ‡ΎπŸ‡ͺ</span>

:::

Flag Emoji UTF8

Returns the flag emoji in UTF-8 format.

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

$country->getFlagEmojiUtf8();

Output Html

Returns the flag emoji in UTF-8 format wrapped in an HTML element.

->getFlagEmojiUtf8WithHtmlCode()

::: code-group

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

$country->getFlagEmojiUtf8WithHtmlCode();
<span>πŸ‡·πŸ‡Ί</span>

:::

Flag Emoji UTF16

Returns the flag emoji in UTF-16 format.

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

$country->getFlagEmojiUtf16();

Output Html

Returns the flag emoji in UTF-16 format wrapped in an HTML element.

// Output Html and Css Code
->getFlagEmojiUtf16WithCode(string $divId = 'emoji-utf16')
// Output Html Code
->getFlagEmojiUtf16WithHtmlCode(string $divId = 'emoji-utf16')
// Output Script Code
->getFlagEmojiUtf16WithScriptCode(string $divId = 'emoji-utf16', bool $withTag = false)

::: code-group

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

$country->getFlagEmojiUtf16WithCode();
<span id="emoji-utf16"></span>

<script>
    document.getElementById("emoji-utf16").innerText = "\uD83C\uDDE7\uD83C\uDDF7";
</script>

:::

Output Html and JavaScript

Returns the flag emoji in UTF-16 format wrapped in an HTML element and includes JavaScript to update the HTML element.

::: code-group

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

$country->getFlagEmojiUtf16WithHtmlCode();
<span id="emoji-utf16"></span>

:::

::: code-group

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

$country->getFlagEmojiUtf16WithScriptCode();
<script>
    document.getElementById("emoji-utf16").innerText = "\uD83C\uDDE7\uD83C\uDDF7";
</script>
    document.getElementById("emoji-utf16").innerText = "\uD83C\uDDE7\uD83C\uDDF7";

:::

Flag Emoji Unicode Code

Returns the flag emoji as a Unicode code point.

Flag Emoji Hexadecimal

Returns the flag emoji as a hexadecimal representation.

Output Html

Returns the flag emoji as a hexadecimal representation wrapped in an HTML element.

Flag Emoji HTML Entity

Returns the flag emoji as an HTML entity.

Output Html

Returns the flag emoji as an HTML entity wrapped in an HTML element.

Flag Emoji CSS

Returns the flag emoji as a CSS value.

Output CSS and Html

Returns the flag emoji as a CSS value and includes an HTML element for styling the flag emoji.

Flag Emoji Decimal

Returns the flag emoji as a decimal representation.

Output Html

Returns the flag emoji as a decimal representation wrapped in an HTML element.

Flag Emoji Shortcode

Returns the flag emoji as a shortcode.

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.
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
atriumphp/atrium