From f15d41d8a1eb8ba4482988c9a660a0f6e22047b2 Mon Sep 17 00:00:00 2001 From: mtvbrianking Date: Mon, 15 Apr 2024 23:03:38 +0300 Subject: [PATCH] getContentType deprecated --- src/Http/Middleware/RequireXml.php | 2 +- src/LaravelXmlServiceProvider.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Http/Middleware/RequireXml.php b/src/Http/Middleware/RequireXml.php index c4a388e..4ce8796 100644 --- a/src/Http/Middleware/RequireXml.php +++ b/src/Http/Middleware/RequireXml.php @@ -19,7 +19,7 @@ class RequireXml */ public function handle($request, Closure $next, $isValidXml = false) { - if ('xml' !== $request->getContentType()) { + if ('xml' !== $request->getContentTypeFormat()) { return response()->xml(['message' => 'Only accepting content of type XML.'], 415); } diff --git a/src/LaravelXmlServiceProvider.php b/src/LaravelXmlServiceProvider.php index 93c6479..eccb25b 100644 --- a/src/LaravelXmlServiceProvider.php +++ b/src/LaravelXmlServiceProvider.php @@ -30,7 +30,7 @@ public function boot(): void * @return bool */ Request::macro('isXml', function () { - return 'xml' === $this->getContentType(); + return 'xml' === $this->getContentTypeFormat(); }); /* @@ -39,7 +39,7 @@ public function boot(): void * @return bool */ Request::macro('sentXml', function () { - return 'xml' === $this->getContentType(); + return 'xml' === $this->getContentTypeFormat(); }); /*