Framework update, and moved markup() helper to new helpers.php

This commit is contained in:
Deon George 2023-05-03 18:24:14 +10:00
parent 4f19da5987
commit 72648ea14d
3 changed files with 255 additions and 297 deletions

View File

@ -44,7 +44,10 @@
"App\\": "app/", "App\\": "app/",
"Database\\Factories\\": "database/factories/", "Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/" "Database\\Seeders\\": "database/seeders/"
} },
"files": [
"helpers.php"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {

538
composer.lock generated

File diff suppressed because it is too large Load Diff

9
helpers.php Normal file
View File

@ -0,0 +1,9 @@
<?php
if (! function_exists('markup')) {
function markup($a,$b) {
return ($a > $b)
? sprintf('<span class="badge bg-danger>">(%3.1f%%)</span>',$a ? ($b-$a)/($b ?: 1)*100 : 100)
: sprintf('<span class="badge">%3.1f%%</span>',$a ? ($b-$a)/($b ?: 1)*100 : ($b ? 100: 0));
}
}