#116 - cr fix
This commit is contained in:
11
app/Domain/Notifications/Channels.php
Normal file
11
app/Domain/Notifications/Channels.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Domain\Notifications;
|
||||
|
||||
class Channels
|
||||
{
|
||||
public const MAIL = "mail";
|
||||
public const SLACK = "slack";
|
||||
}
|
@@ -19,10 +19,10 @@ class KeyHasBeenGivenNotification extends Notification
|
||||
|
||||
public function via(): array
|
||||
{
|
||||
return ["slack"];
|
||||
return [Channels::SLACK];
|
||||
}
|
||||
|
||||
public function toSlack($notifiable): string
|
||||
public function toSlack(Notifiable $notifiable): string
|
||||
{
|
||||
return __(":sender gives key no :key to :recipient", [
|
||||
"sender" => $this->getName($this->sender),
|
||||
|
@@ -19,10 +19,10 @@ class KeyHasBeenTakenNotification extends Notification
|
||||
|
||||
public function via(): array
|
||||
{
|
||||
return ["slack"];
|
||||
return [Channels::SLACK];
|
||||
}
|
||||
|
||||
public function toSlack($notifiable): string
|
||||
public function toSlack(Notifiable $notifiable): string
|
||||
{
|
||||
return __(":recipient takes key no :key from :sender", [
|
||||
"recipient" => $this->getName($this->recipient),
|
||||
|
10
app/Domain/Notifications/Notifiable.php
Normal file
10
app/Domain/Notifications/Notifiable.php
Normal file
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Toby\Domain\Notifications;
|
||||
|
||||
interface Notifiable
|
||||
{
|
||||
public function notify($instance);
|
||||
}
|
@@ -20,7 +20,7 @@ class VacationRequestCreatedNotification extends Notification
|
||||
|
||||
public function via(): array
|
||||
{
|
||||
return ["mail", "slack"];
|
||||
return [Channels::MAIL, Channels::SLACK];
|
||||
}
|
||||
|
||||
public function toSlack(): string
|
||||
|
@@ -22,7 +22,7 @@ class VacationRequestStatusChangedNotification extends Notification
|
||||
|
||||
public function via(): array
|
||||
{
|
||||
return ["mail", "slack"];
|
||||
return [Channels::MAIL, Channels::SLACK];
|
||||
}
|
||||
|
||||
public function toSlack(): string
|
||||
|
@@ -23,7 +23,7 @@ class VacationRequestWaitsForApprovalNotification extends Notification
|
||||
|
||||
public function via(): array
|
||||
{
|
||||
return ["mail", "slack"];
|
||||
return [Channels::MAIL, Channels::SLACK];
|
||||
}
|
||||
|
||||
public function toSlack(): string
|
||||
|
Reference in New Issue
Block a user