Skip to content

Commit

Permalink
getContentType deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
mtvbrianking committed Apr 15, 2024
1 parent a1ea3be commit f15d41d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Http/Middleware/RequireXml.php
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions src/LaravelXmlServiceProvider.php
Expand Up @@ -30,7 +30,7 @@ public function boot(): void
* @return bool
*/
Request::macro('isXml', function () {
return 'xml' === $this->getContentType();
return 'xml' === $this->getContentTypeFormat();
});

/*
Expand All @@ -39,7 +39,7 @@ public function boot(): void
* @return bool
*/
Request::macro('sentXml', function () {
return 'xml' === $this->getContentType();
return 'xml' === $this->getContentTypeFormat();
});

/*
Expand Down

0 comments on commit f15d41d

Please sign in to comment.