1. Go to this page and download the library: Download senither/version-comparison 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/ */
senither / version-comparison example snippets
return [
/*
|--------------------------------------------------------------------------
| Version Tracking ID
|--------------------------------------------------------------------------
|
| The unique ID for the project that the latest git commit SHA
| should be compared with via the API, this can be found on
| the version tracker when selecting the project.
|
| @url https://vt.senither.com/dashboard
*/
'id' => env('VERSION_COMPARISON_ID', null),
/*
|--------------------------------------------------------------------------
| Cache Expiration Times
|--------------------------------------------------------------------------
|
| The amount of time in seconds that should elapse before
| the current commit hash is refreshed, or the latest
| version is fetched from the API.
|
*/
'cache_time' => [
'version' => 7200,
'commit_hash' => 3600,
],
];
use Senither\VersionComparison\Facades\Version;
// Gets the current version
Version::getCurrentVersion();