PHP code example of connorhowell / laravel-git-version

1. Go to this page and download the library: Download connorhowell/laravel-git-version 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/ */

    

connorhowell / laravel-git-version example snippets


use ConnorHowell\LaravelGitVersion\Facades\LaravelGitVersion;

// Get all version information
$versionInfo = LaravelGitVersion::getVersionInfo();
// Returns: ['version' => 'abc123...', 'repo' => 'https://github.com/user/repo', 'commit_url' => 'https://github.com/user/repo/commit/abc123...']

// Get just the current commit hash
$commitHash = LaravelGitVersion::getCurrentGitCommitHash();

// Get the repository URL
$repoUrl = LaravelGitVersion::getGitUrl();

// Get the URL to the current commit
$commitUrl = LaravelGitVersion::getCurrentCommitUrl();

use ConnorHowell\LaravelGitVersion\LaravelGitVersion;

// Get all version information
$versionInfo = LaravelGitVersion::getVersionInfo();

// Get the URL to the current commit
$commitUrl = LaravelGitVersion::getCurrentCommitUrl();