Skip to content

Commit aba988c

Browse files
committed
refactor(class): remove unused classes slack-logging
1 parent dae05a9 commit aba988c

File tree

7 files changed

+14
-68
lines changed

7 files changed

+14
-68
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ phpstan.neon
3030
testbench.yaml
3131
/docs
3232
/coverage
33+
34+
workbench

composer.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"require": {
1919
"php": "^8.2",
2020
"illuminate/contracts": "^10.0||^11.0||^12.0",
21+
"laravel/slack-notification-channel": "^3.5",
2122
"spatie/laravel-package-tools": "^1.16"
2223
},
2324
"require-dev": {
@@ -81,12 +82,9 @@
8182
"laravel": {
8283
"providers": [
8384
"Kevariable\\SlackLogging\\SlackLoggingServiceProvider"
84-
],
85-
"aliases": {
86-
"SlackLogging": "Kevariable\\SlackLogging\\Facades\\SlackLogging"
87-
}
85+
]
8886
}
8987
},
9088
"minimum-stability": "dev",
9189
"prefer-stable": true
92-
}
90+
}

database/factories/ModelFactory.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

database/migrations/create_skeleton_table.php.stub

Lines changed: 0 additions & 19 deletions
This file was deleted.

resources/views/.gitkeep

Whitespace-only changes.

src/Facades/SlackLogging.php

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/SlackLogging.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function isSkipException($exceptionClass): bool
163163
*/
164164
private function logError($exception): void
165165
{
166-
$date = date('Y-m-d H:i:s');
166+
$date = date(format: 'Y-m-d H:i:s');
167167

168168
$slack = (new SlackMessage)
169169
->headerBlock(
@@ -173,21 +173,21 @@ private function logError($exception): void
173173
)
174174
->dividerBlock()
175175
->sectionBlock(function (SectionBlock $block) use ($exception, $date) {
176+
$block->field("*{$exception['exception']}*")->markdown();
176177
$block->field("*Full URL:*\n{$exception['fullUrl']}")->markdown();
177178
$block->field("*Class Exception:*\n{$exception['class']}")->markdown();
178179
$block->field("*File:*\n{$exception['file']}")->markdown();
179180
$block->field("*Line:*\n{$exception['line']}")->markdown();
180181
$block->field("*Date:*\n{$date}")->markdown();
181-
182-
if (filled($this->getUser())) {
183-
$block->field("*User:*\n{$this->getUser()['email']}")->markdown();
184-
}
185-
})
186-
->sectionBlock(function (SectionBlock $block) use ($exception) {
187-
$block->text("*Error:*\n{$exception['error']}")->markdown();
188182
});
189183

190-
Http::post(url: config('slack-logging.webhook_url'), data: $slack->toArray());
184+
$url = config('slack-logging.webhook_url');
185+
186+
if (blank($url)) {
187+
return;
188+
}
189+
190+
Http::post(url: $url, data: $slack->toArray());
191191
}
192192

193193
public function isSleepingException(array $data): bool

0 commit comments

Comments
 (0)