24 lines
496 B
PHP
Executable File
24 lines
496 B
PHP
Executable File
<?php
|
|
|
|
namespace App\Support;
|
|
|
|
use Illuminate\Support\Facades\Process;
|
|
|
|
class AppVersion
|
|
{
|
|
public static function gitHash(): string
|
|
{
|
|
return trim(Process::run('git rev-parse --short HEAD')->output()) ?: 'unknown';
|
|
}
|
|
|
|
public static function gitBranch(): string
|
|
{
|
|
return trim(Process::run('git rev-parse --abbrev-ref HEAD')->output()) ?: 'unknown';
|
|
}
|
|
|
|
public static function buildDate(): string
|
|
{
|
|
return now()->format('Y-m-d H:i:s');
|
|
}
|
|
}
|