- What is scalar/symfony and can I use it in a Laravel app?
- scalar/symfony is a Symfony bundle that integrates Scalar's API reference UI so you can serve interactive OpenAPI/Swagger documentation from a Symfony application. It is not a Laravel package: it has no Laravel service provider, config publish tag, or config/scalar.php surface, and installing it directly into Laravel is unsupported. Laravel teams should use a community Laravel wrapper around the same Scalar client or port the bundle's thin surface (service provider, config file, one docs route, and a Blade view).
- Does scalar/symfony support Laravel 10 or Laravel 11?
- No. The package targets Symfony 6.4, 7.2+, and 8.x on PHP 8.2+, and it relies on Symfony bundle registration, Flex recipes, and Symfony route/config conventions. There is no stated Laravel support, so any Laravel 10/11 feature claims would be inference rather than documented compatibility. Plan on a wrapper or a port if you need this in Laravel.
- How do I install and configure scalar/symfony?
- Install it with Composer in a Symfony application, register the bundle, and point the configuration at your OpenAPI specification, which can be a URL, inline YAML, or a local file. You can configure the routes for the docs UI and the specification endpoint, and no separate frontend build is required. The exact option names and defaults should be checked against the bundle's README and your Symfony version.
- What OpenAPI spec formats and sources does scalar/symfony support?
- The bundle supports OpenAPI/Swagger definitions in JSON and YAML. It can render from remote URLs, inline YAML, and local files, which makes it flexible for generated specs and hand-maintained definitions. Because it reads server-side paths and may fetch remote specs, you should add guardrails and allowlists rather than exposing arbitrary sources.
- Can scalar/symfony serve multiple API documents or versions?
- Yes. The configuration model supports multi-document rendering, so you can expose separate docs for versioned or domain-specific APIs. That pattern is useful when you have public and internal specs or v1 and v2 endpoints. Verify how the Symfony-side options map to your desired route structure before standardizing on it.
- Is there a Laravel package for Scalar API reference documentation?
- Community Laravel wrappers exist around the same Scalar JavaScript client, but you need to evaluate their maintenance, Laravel version support, and security posture before adopting one. Alternatively, porting scalar/symfony's thin surface to Laravel is a small job: a service provider, a config file, a catch-all docs route, and a Blade view. That port would be unsupported, unowned code that your team carries.
- How should I secure the Scalar docs route in production?
- The scalar/symfony release notes do not document authorization hooks or access control for the docs route, so treat it as something you must protect yourself. Put the route behind Laravel or Symfony auth middleware, an IP allowlist, or a gate, especially for internal APIs. Also restrict local-file and remote-URL spec sources with an allowlist so the endpoint cannot read arbitrary server paths or fetch untrusted URLs.
- Can I pin the Scalar client version loaded by scalar/symfony?
- The default Scalar client URL is unversioned and updates independently of Composer, which decouples the JavaScript bundle from your lockfile. That is a real reproducibility and supply-chain concern for audited environments and can cause 'it changed without a deploy' incidents. Check whether the bundle supports exact version pinning or SRI/hash pinning; if not, self-host or proxy a pinned client asset.
- Is scalar/symfony stable enough for production at version ^0.2.0?
- It is pre-1.0, so ^0.2.0 gives no semver stability guarantees and breaking changes can land in a minor release. The project has also undergone a public rename to scalar/symfony with the Scalar\Symfony namespace, so expect churn. For production, pin exact versions, test upgrades, and avoid depending on undocumented behavior.
- What are alternatives to scalar/symfony for Laravel API documentation?
- Laravel teams commonly use Scribe, Swagger UI, Stoplight, or hand-rolled documentation, and a community Scalar wrapper is another option if you want the same renderer. The underlying Scalar client is framework-agnostic, so the config-driven, route-served, multi-document pattern is portable even though this artifact is Symfony-only. Choose based on OpenAPI support, auth requirements, and whether you can own a small port.