Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit 665edd6

Browse files
committed
update hepler list country and list currency
1 parent 5c362da commit 665edd6

File tree

5 files changed

+446
-251
lines changed

5 files changed

+446
-251
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v1.0.2 - 2021-07-17
2+
3+
### Fixed
4+
5+
- Update new helpers.
6+
7+
18
## v1.0.1 - 2021-07-10
29

310
### Fixed

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ gender_female(); // Get gender female - Ex: 1 - female
7777

7878
page_limit(); // Get page limit default in pagination - Ex: 12
7979

80+
check_active_menu($menu, $url); // Check active menu. $menu is router menu
81+
8082
```
8183

8284
2. Datetime
@@ -96,6 +98,8 @@ custom_date('2021-07-01 00:00:01', 'H:i:s d/m/Y'); // Get customer date with for
9698

9799
custom_date('2021-07-01 00:00:01', 'H:i:s d/m/Y', 'en_EN'); // Get customer date with format and locale for diffForHumans - Ex: 00:00:01 01/07/2021 or 1 seconds or 1 minutes.
98100

101+
get_list_timezones(); // Get list timezones - response array
102+
99103
```
100104

101105
3. Images
@@ -123,11 +127,15 @@ get_client_ip(); // Get client ip from https://ipinfo.io
123127

124128
code_to_country('EN'); // Convert country code to country name. Ex: EN to English
125129

126-
get_os(); // get OS client using
130+
get_os(); // Get OS client using
131+
132+
get_client_browser(); // Get client browser using
133+
134+
get_device(); // Get client device using
127135

128-
get_client_browser(); // get client browser using
136+
get_country_list(); // Get list country world
129137

130-
get_device(); // get client device using
138+
get_list_currency(); // Get list currency
131139

132140
```
133141

src/Helpers/hwa_commons.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,28 @@ function generate_random_string($length = 10) {
210210
return $randomString;
211211
}
212212
}
213+
214+
/*
215+
|--------------------------------------------------------------------------
216+
| check_active_menu
217+
|--------------------------------------------------------------------------
218+
*/
219+
220+
if (!function_exists('check_active_menu')) {
221+
222+
/**
223+
* Check activate menu
224+
*
225+
* @param $menu
226+
* @param $url
227+
* @return bool
228+
*/
229+
function check_active_menu($menu, $url)
230+
{
231+
if (!$menu || !$url) return false;
232+
$arr_menu = explode('/', $menu);
233+
$arr_url = explode('/', $url);
234+
if (end($arr_url) != end($arr_menu)) return false;
235+
return true;
236+
}
237+
}

src/Helpers/hwa_datetime.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,17 @@ function custom_date($date, $format = 'H:i:s d/m/Y', $locale = null)
8484
return Carbon::parse($date)->format($format);
8585
}
8686
}
87+
88+
/*
89+
|--------------------------------------------------------------------------
90+
| Get list timezone name
91+
|--------------------------------------------------------------------------
92+
*/
93+
94+
if (!function_exists('get_list_timezones')) {
95+
96+
function get_list_timezones()
97+
{
98+
return DateTimeZone::listIdentifiers(DateTimeZone::ALL);
99+
}
100+
}

0 commit comments

Comments
 (0)