Add stats and current git commit to footer
This commit is contained in:
19
app/Helpers/GitHelper.php
Normal file
19
app/Helpers/GitHelper.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class GitHelper
|
||||
{
|
||||
public static function shortCommit()
|
||||
{
|
||||
return Cache::remember("git_commit", now()->addMinutes(60), function () {
|
||||
try {
|
||||
return trim(exec('git rev-parse --short HEAD'));
|
||||
} catch (\Exception $e) {
|
||||
return 'unknown';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user