Add (routes): All routes possible
Add (pages): home country page
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
if (! function_exists('is_empty')) {
|
||||
/**
|
||||
* A better function to check if a value is empty or null. Strings, arrays, and Objects are supported.
|
||||
@@ -35,3 +37,49 @@ function is_empty($value): bool
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('get_country_name_by_iso')) {
|
||||
function get_country_name_by_iso($country_iso)
|
||||
{
|
||||
if (! is_empty($country_iso)) {
|
||||
|
||||
$country_iso = strtoupper($country_iso);
|
||||
|
||||
try {
|
||||
return config("platform.country_codes.{$country_iso}")['name'];
|
||||
}
|
||||
catch (\Exception $e) {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return 'International';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (! function_exists('get_country_emoji_by_iso')) {
|
||||
function get_country_emoji_by_iso($country_iso)
|
||||
{
|
||||
if (! is_empty($country_iso)) {
|
||||
|
||||
$country_iso = strtoupper($country_iso);
|
||||
|
||||
try {
|
||||
return config("platform.country_codes.{$country_iso}")['emoji'];
|
||||
}
|
||||
catch (\Exception $e) {}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return '🌎';
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('str_random')) {
|
||||
function str_random($length = 10)
|
||||
{
|
||||
return Str::random($length);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user