25 lines
534 B
PHP
25 lines
534 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support;
|
|
|
|
class AppVersion
|
|
{
|
|
/**
|
|
* Get the current app asset version derived from the Vite manifest's last modified time.
|
|
*/
|
|
public static function get(): string
|
|
{
|
|
// Try manifest path
|
|
$manifestPath = BASE_PATH . '/public/build/.vite/manifest.json';
|
|
|
|
if (file_exists($manifestPath)) {
|
|
return (string) filemtime($manifestPath);
|
|
}
|
|
|
|
// Fallback for non-build environments
|
|
return '1';
|
|
}
|
|
}
|