Apply theme globally; add mail templates into theme folder #715

This commit is contained in:
Nabeel Shahzad 2020-05-22 18:58:09 -04:00
parent fb7d988032
commit 09cd7adb6b
32 changed files with 19 additions and 1 deletions

View File

@ -45,6 +45,7 @@ class Kernel extends HttpKernel
ShareErrorsFromSession::class,
// VerifyCsrfToken::class,
SubstituteBindings::class,
SetActiveTheme::class,
],
];

View File

@ -15,6 +15,23 @@ class SetActiveTheme implements Middleware
{
public function handle(Request $request, Closure $next)
{
$skip = [
'admin',
'admin/*',
'api',
'api/*',
'importer',
'importer/*',
'install',
'install/*',
'update',
'update/*',
];
if ($request->is($skip)) {
return $next($request);
}
try {
$theme = setting('general.theme');
} catch (\Exception $e) {

View File

@ -39,7 +39,7 @@ class RouteServiceProvider extends ServiceProvider
private function mapWebRoutes()
{
Route::group([
'middleware' => ['web', 'theme'],
'middleware' => ['web'],
'namespace' => $this->namespace,
], function ($router) {
Route::group([