aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilly Micieli <micieli@laposte.net>2019-10-25 15:40:47 +0200
committerWilly Micieli <micieli@laposte.net>2019-10-25 15:40:47 +0200
commit77eddb67a0d0435cbe498ceffb2b6eab894f20c3 (patch)
treefc0af185581725c3622681995c27573ff3836aae
parenta02241f8f93ee377804cb012b3d4fbe85009a595 (diff)
downloadimperium-77eddb67a0d0435cbe498ceffb2b6eab894f20c3.zip
imperium-77eddb67a0d0435cbe498ceffb2b6eab894f20c3.tar.gz
add removed helpers
-rw-r--r--helpers/web.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/helpers/web.php b/helpers/web.php
index 5435c6a..6ce099a 100644
--- a/helpers/web.php
+++ b/helpers/web.php
@@ -430,6 +430,49 @@ use Imperium\Model\Web;
}
+ if(!function_exists('fa'))
+ {
+ /**
+ *
+ * Generate a fa icon
+ *
+ * @method fa
+ *
+ * @param string $prefix The fa prefix
+ * @param string $icon The fa icon name
+ * @param string $options The fa options
+ *
+ * @return string
+ *
+ */
+ function fa(string $prefix,string $icon, string $options = ''): string
+ {
+ $x = "$prefix $icon $options";
+ return '<i class="'.$x.'"></i>';
+ }
+ }
+
+ if (!function_exists('ago'))
+ {
+ /**
+ *
+ * @param string $time
+ * @param null $tz
+ *
+ * @return string
+ *
+ * @throws DependencyException
+ * @throws Kedavra
+ * @throws NotFoundException
+ */
+ function ago(string $time,$tz = null):string
+ {
+ Carbon::setLocale(app()->lang());
+
+ return Carbon::parse($time,$tz)->diffForHumans();
+
+ }
+ }
if (!function_exists('detect_method'))
{
/**