From e42ac1197d35e1332cf6834ac01d6306616d202b Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 18 Feb 2022 19:06:09 +1100 Subject: [PATCH] Performance improvements for Swoole --- app/Providers/MailCssInlinerServiceProvider.php | 13 ++++++++++++- .../ninja2020/components/pdf-viewer.blade.php | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/Providers/MailCssInlinerServiceProvider.php b/app/Providers/MailCssInlinerServiceProvider.php index a3e223a4a1..3bcf968165 100644 --- a/app/Providers/MailCssInlinerServiceProvider.php +++ b/app/Providers/MailCssInlinerServiceProvider.php @@ -12,6 +12,7 @@ namespace App\Providers; use App\Utils\CssInlinerPlugin; +use Illuminate\Container\Container; use Illuminate\Mail\MailManager; use Illuminate\Support\ServiceProvider; @@ -38,8 +39,18 @@ class MailCssInlinerServiceProvider extends ServiceProvider */ public function register() { - $this->app->singleton(CssInlinerPlugin::class, function ($app) { + // $this->app->singleton(CssInlinerPlugin::class, function ($app) { + // return new CssInlinerPlugin([]); + // }); + + // $this->app->singleton(CssInlinerPlugin::class, function ($app) { + // return new CssInlinerPlugin([]); + // }); + + $this->app->bind(CssInlinerPlugin::class, function($app) { return new CssInlinerPlugin([]); }); } } + + diff --git a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php index 52f3aaa8b8..6812bfcbb0 100644 --- a/resources/views/portal/ninja2020/components/pdf-viewer.blade.php +++ b/resources/views/portal/ninja2020/components/pdf-viewer.blade.php @@ -1,5 +1,5 @@ @php - $mobile = stripos($_SERVER['HTTP_USER_AGENT'], 'Android') || stripos($_SERVER['HTTP_USER_AGENT'], 'iPhone') || stripos($_SERVER['HTTP_USER_AGENT'], 'iPod') || stripos($_SERVER['HTTP_USER_AGENT'], 'iPad'); + $mobile = stripos(request()->server('HTTP_USER_AGENT'), 'Android') || stripos(request()->server('HTTP_USER_AGENT'), 'iPhone') || stripos(request()->server('HTTP_USER_AGENT'), 'iPod') || stripos(request()->server('HTTP_USER_AGENT'), 'iPad'); @endphp @push('head')