Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] implementing support for custom notification channels #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Carnicero90
Copy link

Kinda built-in support for custom notifications. Had to change viaQueues as well to make it compatible with this commit.
Sample Usage:
`<?php

class customFWChannel {
public function send($notifiable, \Akaunting\Firewall\Notifications\AttackDetected $a) {
\Log::debug('sending to a custom channel');
}
}

config()->set('firewall.notifications.custom', [
'enabled' => true,
'channel' => customFWChannel::class,
'queue' => 'customqueue'
]);

$fakeAttack = (object) [
"ip" => "192.168.240.1",
"level" => "medium",
"middleware" => "url",
"user_id" => 0,
"url" => "http://localhost/admin",
"referrer" => "NULL",
"request" => "",
"updated_at" => "2023-10-02T08:53:24.000000Z",
"created_at" => "2023-10-02T08:53:24.000000Z",
"id" => 61
];
(new \Akaunting\Firewall\Notifications\Notifiable)->notify(
new \Akaunting\Firewall\Notifications\AttackDetected($fakeAttack)
);`

@Carnicero90 Carnicero90 changed the title [FEATURE REQUEST] implementig support for custom notification channels [FEATURE REQUEST] implementing support for custom notification channels Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant