1. Go to this page and download the library: Download codedge/laravel-selfupdater 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/ */
Route::get('/', function (\Codedge\Updater\UpdaterManager $updater) {
// Check if new version is available
if($updater->source()->isNewVersionAvailable()) {
// Get the current installed version
echo $updater->source()->getVersionInstalled();
// Get the new version available
$versionAvailable = $updater->source()->getVersionAvailable();
// Create a release
$release = $updater->source()->fetch($versionAvailable);
// Run the update process
$updater->source()->update($release);
} else {
echo "No new version available.";
}
});