Skip to content

Commit

Permalink
491 Installation Error (#495)
Browse files Browse the repository at this point in the history
* Disable CSRF token

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

* Note about logs in issue template

* Formatting
  • Loading branch information
nabeelio authored Jan 14, 2020
1 parent aafc968 commit d4da0a6
Show file tree
Hide file tree
Showing 5 changed files with 371 additions and 270 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.
A clear and concise description of what the bug is. Please upload the Laravel logs as well from `storage/logs/laravel.log` (or the file with the correct date)

**Version**
Please enter the version
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use App\Http\Middleware\JsonResponse;
use App\Http\Middleware\RedirectIfAuthenticated;
use App\Http\Middleware\UpdatePending;
use App\Http\Middleware\VerifyCsrfToken;
use Illuminate\Auth\Middleware\Authenticate;
use Illuminate\Auth\Middleware\Authorize;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
Expand Down Expand Up @@ -41,7 +40,7 @@ class Kernel extends HttpKernel
AddQueuedCookiesToResponse::class,
StartSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
// VerifyCsrfToken::class,
SubstituteBindings::class,
],
];
Expand Down
9 changes: 8 additions & 1 deletion app/Http/Middleware/SetActiveTheme.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.0",
"barryvdh/laravel-ide-helper": "^2.0",
"barryvdh/laravel-ide-helper": "^2.6",
"bpocallaghan/generators": "5.0.1",
"codedungeon/phpunit-result-printer": "^0.13.0",
"filp/whoops": "~2.0",
Expand Down
Loading

0 comments on commit d4da0a6

Please sign in to comment.