@@ -18,56 +18,45 @@ public function __construct($exception, array $exceptionContext = [])
18
18
public function getCard ()
19
19
{
20
20
return [
21
- '@type ' => 'MessageCard ' ,
22
- '@context ' => 'http://schema.org/extensions ' ,
23
- 'summary ' => config ('laravel_alert_notifications.microsoft_teams.cardSubject ' ),
24
- 'themeColor ' => config ('laravel_alert_notifications.themeColor ' ),
25
- 'title ' => config ('laravel_alert_notifications.cardSubject ' ),
26
- 'sections ' => [
21
+ '@type ' => 'AdaptiveCard ' ,
22
+ '@context ' => 'https://adaptivecards.io/schemas/adaptive-card.json ' ,
23
+ 'version ' => '1.2 ' ,
24
+ 'body ' => [
27
25
[
28
- 'activityTitle ' => config ('laravel_alert_notifications.microsoft_teams.cardSubject ' ),
29
- 'activitySubtitle ' => 'Error has occurred on ' .config ('app.name ' ).' - ' .config ('app.name ' ),
30
- 'activityImage ' => '' ,
31
- 'facts ' => [
32
- [
33
- 'name ' => 'Environment: ' ,
34
- 'value ' => config ('app.env ' ),
35
- ],
36
- [
37
- 'name ' => 'Server: ' ,
38
- 'value ' => Request::server ('SERVER_NAME ' ),
39
- ],
40
- [
41
- 'name ' => 'Request Url: ' ,
42
- 'value ' => Request::fullUrl (),
43
- ],
44
- [
45
- 'name ' => 'Exception: ' ,
46
- 'value ' => get_class ($ this ->exception ),
47
- ],
48
- [
49
- 'name ' => 'Message: ' ,
50
- 'value ' => $ this ->exception ->getMessage (),
51
- ],
52
- [
53
- 'name ' => 'Exception Code: ' ,
54
- 'value ' => $ this ->exception ->getCode (),
55
- ],
56
- [
57
- 'name ' => 'In File: ' ,
58
- 'value ' => '<b style="color:red;"> '
59
- .$ this ->exception ->getFile ()
60
- .' on line ' .$ this ->exception ->getLine ().'</b> ' ,
61
- ],
62
- [
63
- 'name ' => 'Stack Trace: ' ,
64
- 'value ' => '<pre> ' .$ this ->exception ->getTraceAsString ().'</pre> ' ,
65
- ],
66
- [
67
- 'name ' => 'Context: ' ,
68
- 'value ' => '<pre>$context = ' .var_export ($ this ->exceptionContext , true ).';</pre> ' ,
69
- ],
70
- ],
26
+ 'type ' => 'TextBlock ' ,
27
+ 'text ' => 'Environment: ' . config ('app.env ' ),
28
+ ],
29
+ [
30
+ 'type ' => 'TextBlock ' ,
31
+ 'text ' => 'Server: ' . Request::server ('SERVER_NAME ' ),
32
+ ],
33
+ [
34
+ 'type ' => 'TextBlock ' ,
35
+ 'text ' => 'Request Url: ' . Request::fullUrl (),
36
+ ],
37
+ [
38
+ 'type ' => 'TextBlock ' ,
39
+ 'text ' => 'Exception: ' . get_class ($ this ->exception ),
40
+ ],
41
+ [
42
+ 'type ' => 'TextBlock ' ,
43
+ 'text ' => 'Message: ' . $ this ->exception ->getMessage (),
44
+ ],
45
+ [
46
+ 'type ' => 'TextBlock ' ,
47
+ 'text ' => 'Exception Code: ' . $ this ->exception ->getCode (),
48
+ ],
49
+ [
50
+ 'type ' => 'TextBlock ' ,
51
+ 'text ' => 'In File: ' . $ this ->exception ->getFile () . ' on line ' . $ this ->exception ->getLine (),
52
+ ],
53
+ [
54
+ 'type ' => 'TextBlock ' ,
55
+ 'text ' => 'Stack Trace: ' . $ this ->exception ->getTraceAsString (),
56
+ ],
57
+ [
58
+ 'type ' => 'TextBlock ' ,
59
+ 'text ' => 'Context: ' . var_export ($ this ->exceptionContext , true ),
71
60
],
72
61
],
73
62
];
0 commit comments