fix: make pushover settings more clear

- Rename User to User Key
- Rename Token to API Token
- fix: helper and docs links
This commit is contained in:
peaklabs-dev
2024-12-11 19:18:39 +01:00
parent ebfc8a1094
commit 92fec9582c
6 changed files with 38 additions and 40 deletions

View File

@@ -15,8 +15,8 @@ class PushoverNotificationSettings extends Model
'team_id',
'pushover_enabled',
'pushover_user',
'pushover_token',
'pushover_user_key_key',
'pushover_api_token',
'deployment_success_pushover_notifications',
'deployment_failure_pushover_notifications',
@@ -29,12 +29,12 @@ class PushoverNotificationSettings extends Model
'server_disk_usage_pushover_notifications',
'server_reachable_pushover_notifications',
'server_unreachable_pushover_notifications',
];
];
protected $casts = [
'pushover_enabled' => 'boolean',
'pushover_user' => 'encrypted',
'pushover_token' => 'encrypted',
'pushover_user_key_key' => 'encrypted',
'pushover_api_token' => 'encrypted',
'deployment_success_pushover_notifications' => 'boolean',
'deployment_failure_pushover_notifications' => 'boolean',

View File

@@ -4,8 +4,8 @@ namespace App\Models;
use App\Notifications\Channels\SendsDiscord;
use App\Notifications\Channels\SendsEmail;
use App\Notifications\Channels\SendsSlack;
use App\Notifications\Channels\SendsPushover;
use App\Notifications\Channels\SendsSlack;
use App\Traits\HasNotificationSettings;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Model;
@@ -33,7 +33,7 @@ use OpenApi\Attributes as OA;
]
)]
class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsPushover
class Team extends Model implements SendsDiscord, SendsEmail, SendsPushover, SendsSlack
{
use HasNotificationSettings, Notifiable;
@@ -156,12 +156,12 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsP
{
return data_get($this, 'slack_webhook_url', null);
}
public function routeNotificationForPushover()
{
return [
'user' => data_get($this, 'pushover_user', null),
'token' => data_get($this, 'pushover_token', null),
'user' => data_get($this, 'pushover_user_key_key', null),
'token' => data_get($this, 'pushover_api_token', null),
];
}
@@ -287,7 +287,7 @@ class Team extends Model implements SendsDiscord, SendsEmail, SendsSlack, SendsP
{
return $this->hasOne(SlackNotificationSettings::class);
}
public function pushoverNotificationSettings()
{
return $this->hasOne(PushoverNotificationSettings::class);