20 lines
406 B
PHP
20 lines
406 B
PHP
<?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';
|
|
}
|
|
});
|
|
}
|
|
}
|