- How do I install atelier/svg in a Laravel application?
- Install it with Composer using composer require atelier/svg, then bind an application-owned adapter or service in a Laravel service provider. Because the library is framework-agnostic, do not assume Laravel auto-discovery, publishable config, or facade bindings. Confirm the PHP version and DOM/libxml extensions in your runtime before wiring it into controllers or jobs.
- Is atelier/svg a native Laravel package or a framework-agnostic PHP library?
- It is best treated as a framework-agnostic PHP SVG domain library rather than a turnkey Laravel component. You can use it inside Laravel, but expect to write the service provider binding, configuration, validation rules, exception mapping, and storage integration yourself. Keep package types behind an interface such as SvgAssetService so controllers and Blade templates stay clean.
- Does atelier/svg support Laravel 10 and Laravel 11?
- The package has no Laravel-specific version constraint, so Laravel 10 or 11 compatibility depends on its PHP requirement and your runtime extensions. Check composer.json for the supported PHP range, then test the package in the same PHP and extension matrix you use in CI and production. A small pilot is more reliable than assuming framework-version support.
- Is atelier/svg safe for sanitizing user-uploaded SVG files?
- atelier/svg includes sanitization, but SVG sanitizers must be validated against your own threat model before accepting untrusted uploads. Test for script elements, event-handler attributes, external references, CSS imports, foreignObject, and XML entity risks, and keep defense-in-depth controls such as content-type checks and isolated storage. Do not treat any single library as a guarantee without adversarial fixtures.
- How can I render sanitized inline SVG in Blade with atelier/svg?
- Use atelier/svg in an application service to parse, sanitize, and serialize SVG, then output the resulting markup through a Blade component or a carefully reviewed directive. Avoid dumping raw uploaded SVG directly into Blade, and cache sanitized output by content hash and policy version. The package is not a turnkey Blade integration, so the rendering boundary should remain application-owned.
- What PHP extensions does atelier/svg require?
- SVG parsing and serialization typically require the DOM and libxml extensions, so verify the exact ext-* requirements in the package composer.json. Add those extensions to CI and production images, and confirm they are enabled in the PHP SAPIs your Laravel app uses. If your app also handles character encoding or compression, check related extensions separately.
- Can I use atelier/svg for queued icon optimization and morphing in Laravel?
- Yes, optimization, transforms, and morphing are better suited to queued Laravel jobs than high-volume request paths. Configure sanitization and optimization policies in your own config, store source and generated SVGs on configured disks, and cache outputs by content hash plus policy version. Morphing and complex transforms still need browser-rendering checks for geometry and viewBox correctness.
- What are the main production risks of adopting atelier/svg?
- The main production risks are weak adoption evidence, a likely small maintainer base, and the security sensitivity of SVG processing. The package has low stars and dependents, so pin a known-good version, commit the lockfile, and have a fork or replacement plan. Run a bounded pilot on representative assets before using it for user-uploaded content.
- How does atelier/svg compare to alternatives for SVG sanitization in Laravel?
- Alternatives include dedicated SVG sanitizers for upload hardening and broader SVG libraries for generation or manipulation, so choose based on whether you need sanitization alone or a full toolkit. Compare PHP version support, maintained releases, extension requirements, and coverage of scripts, external references, CSS, and foreignObject. For Laravel apps, wrapping either option behind your own SvgAssetService keeps the decision reversible.
- How should I test atelier/svg before using it in a Laravel app?
- Start with a time-boxed proof of concept using real icons, charts, CMS uploads, branded templates, and any morphing cases. Add adversarial sanitization fixtures, compare rendered output in target browsers, and verify PHP and extension compatibility in CI. If the pilot passes, migrate one low-risk workflow behind a feature flag before touching public uploads.