491 Installation Error (#495)

* Disable CSRF token

* Add error handling around looking up the theme and set a default

* Note about logs in issue template

* Formatting
This commit is contained in:
Nabeel S
2020-01-14 13:55:24 -05:00
committed by GitHub
parent aafc9680bf
commit d4da0a6d6a
5 changed files with 371 additions and 270 deletions

View File

@@ -6,6 +6,7 @@ use App\Contracts\Middleware;
use Closure;
use Igaster\LaravelTheme\Facades\Theme;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
/**
* Read the current theme from the settings (set in admin), and set it
@@ -14,7 +15,13 @@ class SetActiveTheme implements Middleware
{
public function handle(Request $request, Closure $next)
{
$theme = setting('general.theme');
try {
$theme = setting('general.theme');
} catch (\Exception $e) {
Log::error($e->getMessage());
$theme = 'default';
}
if (!empty($theme)) {
Theme::set($theme);
}