PHP code example of sunnynath / laravel-release-manager
1. Go to this page and download the library: Download sunnynath/laravel-release-manager 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/ */
sunnynath / laravel-release-manager example snippets
'compatibility' => [
'enabled' => true,
'minimum_client_version' => '2.0.0',
'client_version_header' => 'X-Client-Version',
'allow_missing_client_version' => false,
'incompatible_status' => 426,
'message' => 'Client version is no longer supported.',
],
use Illuminate\Support\Facades\Route;
Route::middleware('release.compatible')->group(function () {
Route::get('/api/profile', ProfileController::class);
});
use Sunnynath\LaravelReleaseManager\Services\CompatibilityManager;
$result = app(CompatibilityManager::class)->check('2.1.0');
$result->compatible();
$result->toArray();
use Illuminate\Support\Facades\Route;
Route::middleware('release.headers')->group(function () {
Route::get('/health', HealthCheckController::class);
});
use Sunnynath\LaravelReleaseManager\Http\Middleware\AddReleaseHeaders;
Route::middleware(AddReleaseHeaders::class)->get('/health', HealthCheckController::class);