code: public static function wantsJsonApi($request)
      {
          $acceptable = $request->getAcceptableContentTypes();
  
          return isset($acceptable[0]) && IlluminateStr::contains($acceptable[0], MediaType::JSON_API_SUB_TYPE);
      }
docs: Does the request want JSON API content?
  
  @param SymfonyRequest $request
  @return bool