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' => [],
],
];
}
}