- How do I install badges/poser in a Laravel application?
- Install it with composer require badges/poser and confirm the package autoloads via PSR-4. badges/poser is a framework-agnostic leaf library, so a typical Laravel integration is a small wrapper class or interface bound in your own service provider. Check the package's PHP version constraint during the spike before rolling it out.
- Does badges/poser require a Laravel service provider or config file?
- No Laravel service provider, migrations, queues, or cache contracts are required for the package's core job of rendering a badge. Auto-discovery is possible but should be verified rather than assumed; if one is registered, it is likely only for optional configuration. If the library ships a config file, publishing it is optional and should be a deliberate choice.
- Which PHP versions and extensions does badges/poser support?
- The exact PHP constraint is not established in the evaluation and must be confirmed from composer.json before adoption. SVG output needs no image extension, while raster output may require ext-gd or ext-imagick, so confirm whether raster support is optional. Test against your Laravel 10 through 12 and PHP 8.2+ matrix.
- Does badges/poser escape badge labels and messages, or is it vulnerable to SVG XSS?
- Badge labels and messages are commonly fed from configuration, git metadata, or CI variables, which makes unescaped text an XSS and XML-injection vector in SVG. The evaluation explicitly says not to assume the library escapes input, so inspect the renderer and test payloads containing angle brackets, quotes, and entity sequences. If any input is attacker-influenced, escape it before rendering or constrain values to a safe allowlist.
- Can I use badges/poser outside Laravel, in plain PHP scripts or CI pipelines?
- Yes. badges/poser is framework-agnostic and can be called from a plain PHP script, an Artisan command, or a CI job that writes badge files into a README. The string-in, string-out shape makes it easy to test and easy to replace. No Laravel runtime is needed for rendering.
- How do I return an SVG badge from a Laravel route or controller?
- Render the badge to a string in a controller or dedicated action, then return a response with the image/svg+xml content type. Keep that action thin and delegate to a BadgeRenderer interface so the dependency stays swappable. Cache the response if badges are generated from stable metadata.
- Can badges/poser build badges from composer.json or Packagist metadata?
- The package is described as Composer-aware and able to build badges from package metadata and common project signals. In practice, read fields from composer.json or Packagist and pass them as label and message values to the renderer. Treat metadata as untrusted for escaping purposes, especially if it comes from CI or third parties.
- Is badges/poser actively maintained, and what is its bus factor?
- The evaluation reports 148 stars, a likely single maintainer, and low commit cadence, with MIT terms and no support obligation. The repository is listed as unknown and a release tag dated 2026-05-28 is a metadata anomaly that should be resolved before adoption. Assume your team owns the code the day it lands and budget for a fork.
- Does badges/poser have tests and a PHP version matrix?
- Tests and a PHP version matrix are open questions in the evaluation, not confirmed facts. Ask the maintainer or inspect the repository for a test suite that runs on the PHP versions you deploy. Because the renderer is small and mockable, you can also cover it with your own contract tests through the adapter.
- What are good alternatives to badges/poser, and how do I migrate from shields.io?
- Common alternatives are hot-linked img.shields.io URLs, hand-templated SVG strings, or a small internal renderer of roughly 40 lines. Migrate in two steps: introduce a BadgeRenderer interface backed by your current approach with no behaviour change, then swap in a badges/poser implementation. That keeps call sites stable if you later drop the dependency.