HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/ai.naniguide.com/app/Notifications/Admin/UpgradePatchAvailable.php
<?php

namespace App\Notifications\Admin;

use App\Notifications\AppNotification;

/**
 * A new patch package has been uploaded / downloaded onto the server but not
 * yet applied. Shared with all admins so anyone can drive the upgrade.
 *
 * Single group key — repeated uploads collapse into one row, and the row gets
 * cleared by UpgradeManager::finalize() (so the upgrade-finalize step is the
 * only resolution path: UI button, `php artisan upgrade:finalize`, or the API
 * Step-2 endpoint all flow through finalize()).
 */
class UpgradePatchAvailable extends AppNotification
{
    public function __construct(
        public string $newVersion,
        public string $currentVersion,
    ) {}

    public function audience(): string { return self::AUDIENCE_ADMINS; }
    public function category(): string { return self::CATEGORY_ACTION; }
    public function severity(): string { return self::SEVERITY_INFO; }

    public function groupKey(): string
    {
        return 'upgrade-patch-available';
    }

    public function toArray(object $notifiable = null): array
    {
        return [
            'title' => trans('refactor/notifications.upgrade_patch_available.title', [
                'version' => $this->newVersion,
            ]),
            'body' => trans('refactor/notifications.upgrade_patch_available.body', [
                'current' => $this->currentVersion,
                'new'     => $this->newVersion,
            ]),
            'action' => [
                'label'  => trans('refactor/notifications.upgrade_patch_available.cta'),
                'route'  => 'refactor.admin.settings.upgrade',
                'params' => [],
            ],
        ];
    }
}