From b35eddd54bf47d533105c5bc4b4713780d023015 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 9 Jul 2024 19:39:37 +0300 Subject: [PATCH] Help guide setting up the app --- app/Exceptions/Handler.php | 5 +++++ resources/views/portal/ninja2020/layout/error.blade.php | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index c580e7b3feae..3ab3c69eb143 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -18,6 +18,7 @@ use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\AuthenticationException; use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException; use Illuminate\Database\Eloquent\RelationNotFoundException; +use Illuminate\Encryption\MissingAppKeyException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Http\Exceptions\ThrottleRequestsException; use Illuminate\Http\Request; @@ -149,6 +150,10 @@ class Handler extends ExceptionHandler } parent::report($exception); + + if (Ninja::isSelfHost() && $exception instanceof MissingAppKeyException) { + \Log::error('To setup the app run "cp .env.example .env" followed by "php artisan key:generate"'); + } } private function validException($exception) diff --git a/resources/views/portal/ninja2020/layout/error.blade.php b/resources/views/portal/ninja2020/layout/error.blade.php index b04dacd5bb5b..b42e706d78f0 100644 --- a/resources/views/portal/ninja2020/layout/error.blade.php +++ b/resources/views/portal/ninja2020/layout/error.blade.php @@ -10,11 +10,17 @@
-
+
@yield('code') — @yield('message') + @if (\App\Utils\Ninja::isSelfHost()) + + Check storage/logs for more details + + @endif + {{ ctrans('texts.back_to', ['url' => parse_url(request()->getHttpHost())['host'] ?? request()->getHttpHost()]) }}