File tree Expand file tree Collapse file tree 3 files changed +31
-32
lines changed Expand file tree Collapse file tree 3 files changed +31
-32
lines changed Original file line number Diff line number Diff line change 22
22
}
23
23
],
24
24
"require" : {
25
- "php" : " >=5.6.4 " ,
26
- "laravel/framework" : " >=5.4 " ,
25
+ "php" : " >=7.0 " ,
26
+ "laravel/framework" : " >=5.5 " ,
27
27
"guzzlehttp/guzzle" : " >=6.0" ,
28
28
"jenssegers/agent" : " 2.6.*"
29
29
},
Original file line number Diff line number Diff line change 3
3
namespace Akaunting \Firewall \Listeners ;
4
4
5
5
use Akaunting \Firewall \Events \AttackDetected as Event ;
6
- use Akaunting \Firewall \Notifications \AttackDetected as Notification ;
7
- use Exception ;
8
- use GuzzleHttp \Exception \RequestException ;
9
- use Illuminate \Notifications \Notifiable ;
6
+ use Akaunting \Firewall \Notifications \AttackDetected ;
7
+ use Akaunting \Firewall \Notifications \Notifiable ;
10
8
use Throwable ;
11
9
12
10
class NotifyUsers
@@ -20,34 +18,10 @@ class NotifyUsers
20
18
*/
21
19
public function handle (Event $ event )
22
20
{
23
- $ notifiable = $ this ->getNotifiableClass ();
24
-
25
21
try {
26
- $ notifiable ->notify (new Notification ($ event ->log ));
27
- } catch (Exception | RequestException | Throwable $ e ) {
22
+ ( new Notifiable ) ->notify (new AttackDetected ($ event ->log ));
23
+ } catch (Throwable $ e ) {
28
24
report ($ e );
29
25
}
30
26
}
31
-
32
- protected function getNotifiableClass ()
33
- {
34
- return new class () {
35
- use Notifiable;
36
-
37
- public function routeNotificationForMail ()
38
- {
39
- return config ('firewall.notifications.mail.to ' );
40
- }
41
-
42
- public function routeNotificationForSlack ()
43
- {
44
- return config ('firewall.notifications.slack.to ' );
45
- }
46
-
47
- public function getKey ()
48
- {
49
- return 1 ;
50
- }
51
- };
52
- }
53
27
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Akaunting \Firewall \Notifications ;
4
+
5
+ use Illuminate \Notifications \Notifiable as NotifiableTrait ;
6
+
7
+ class Notifiable
8
+ {
9
+ use NotifiableTrait;
10
+
11
+ public function routeNotificationForMail ()
12
+ {
13
+ return config ('firewall.notifications.mail.to ' );
14
+ }
15
+
16
+ public function routeNotificationForSlack ()
17
+ {
18
+ return config ('firewall.notifications.slack.to ' );
19
+ }
20
+
21
+ public function getKey ()
22
+ {
23
+ return 1 ;
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments