PHP code example of woweb / laravel-version-endpoint

1. Go to this page and download the library: Download woweb/laravel-version-endpoint library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

woweb / laravel-version-endpoint example snippets


$pair = sodium_crypto_sign_keypair();

echo 'private: '.base64_encode(sodium_crypto_sign_secretkey($pair)).PHP_EOL;
echo 'public:  '.base64_encode(sodium_crypto_sign_publickey($pair)).PHP_EOL;

$timestamp = (string) time();
$path = '/__version';
$signature = base64_encode(
    sodium_crypto_sign_detached($timestamp."\n".$path, $privateKey)
);

$response = Http::withHeaders([
    'X-Register-Timestamp' => $timestamp,
    'X-Register-Signature' => $signature,
])->get('https://example.test'.$path);
bash
php artisan vendor:publish --tag=version-endpoint-config
bash
php artisan version-endpoint:build --tag="$RELEASE_TAG"
json
{
    "php": "8.4.3",
    "framework": "13.29.0",
    "git_tag": "v1.4.0",
    "git_sha": "0c8a1f5e2b...",
    "composer_lock_hash": "sha256:9f2c...",
    "app_env": "production",
    "branch": null,
    "runtimes": {
        "nodejs": "22.9.0",
        "debian": "13",
        "postgresql": "17.6",
        "valkey": "8.1.1"
    },
    "deployed_at": "2026-08-20T19:04:11+00:00",
    "checked_at": "2026-08-27T04:00:02+00:00"
}