Skip to content

Commit 3609d14

Browse files
committed
Update favicon-extension.blade.php
1 parent d169987 commit 3609d14

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22
3-
function localIcon($id) {
4-
$directory = base_path("assets/favicon/icons");
5-
$files = scandir($directory);
6-
$pathinfo = "error.error";
7-
foreach($files as $file) {
8-
if (strpos($file, $id.'.') !== false) {
9-
$pathinfo = $id. "." . pathinfo($file, PATHINFO_EXTENSION);
10-
}}
11-
return $pathinfo;
3+
if (!function_exists('localIcon')) {
4+
function localIcon($id)
5+
{
6+
$directory = base_path("assets/favicon/icons");
7+
$files = scandir($directory);
8+
$pathinfo = "error.error";
9+
foreach ($files as $file) {
10+
if (strpos($file, $id . '.') !== false) {
11+
$pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION);
12+
}
13+
}
14+
return $pathinfo;
15+
}
1216
}
1317
1418
?>

0 commit comments

Comments
 (0)