From 4c9d97d82d856e0a5a7344df431b21272dbfc9dd Mon Sep 17 00:00:00 2001 From: Owen Melbourne Date: Tue, 9 Feb 2021 10:36:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=95=B5=EF=B8=8F=E2=80=8D=E2=99=82?= =?UTF-8?q?=EF=B8=8F=20Debugging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Crawler/CrawlObserver.php | 7 +++++-- resources/views/mail/browser-message.blade.php | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/Crawler/CrawlObserver.php b/app/Crawler/CrawlObserver.php index e576bc1..df5d8c8 100644 --- a/app/Crawler/CrawlObserver.php +++ b/app/Crawler/CrawlObserver.php @@ -9,6 +9,7 @@ use Psr\Http\Message\UriInterface; use Psr\Http\Message\ResponseInterface; use GuzzleHttp\Exception\RequestException; +use App\Notifications\BrowserMessageDetected; use Spatie\Crawler\CrawlObserver as SpatieCrawlObserver; class CrawlObserver extends SpatieCrawlObserver @@ -91,13 +92,15 @@ public function crawlFailed(UriInterface $url, RequestException $requestExceptio $page->response = null; $page->exception = $requestException->getCode() . ' - ' . $requestException->getMessage(); - BrowserConsoleCheck::dispatch($this->website, $page); + $this->notify($page); return $page->save(); } private function notify(CrawledPage $page) { -// dump($page->exception); + $page->website->user->notify( + new BrowserMessageDetected($page->website, $page) + ); } } diff --git a/resources/views/mail/browser-message.blade.php b/resources/views/mail/browser-message.blade.php index 209b0b0..eb999fc 100644 --- a/resources/views/mail/browser-message.blade.php +++ b/resources/views/mail/browser-message.blade.php @@ -6,7 +6,7 @@ Please see the output below:
-
{{ $page->messages }}
+
{{ $page->messages ?? $page->exception ?? $page->response }}
@component('mail::button', ['url' => $website->show_link])