- How do I install chriskonnertz/open-graph in a Laravel app?
- Install it with composer require chriskonnertz/open-graph. The package ships no Laravel service provider, facade, config file, or Blade directives, so you instantiate it in a presenter, controller, or dedicated SEO class and render the resulting meta tags in your template. Because the last tagged release is from 2019, confirm Composer resolves it on your PHP version before adopting it.
- Does chriskonnertz/open-graph work with Laravel 10, Laravel 11, and PHP 8.2+?
- The library is framework-agnostic and does not depend on a specific Laravel version, so Laravel 10 or 11 compatibility mostly comes down to PHP. The last tagged release is from June 2019 and targets the PHP 7.x era, so Composer may block installation on PHP 8.2–8.4 due to the php platform constraint. Test installation and rendering on your production PHP version, and fork the package if the constraint blocks unrelated upgrades.
- Is chriskonnertz/open-graph safe from XSS when rendering user-supplied titles or descriptions?
- The technical assessment flags output escaping as a high-severity item to verify because it is not confirmed that content values are HTML-escaped. Write a test with a payload such as "><script> before shipping any user-supplied title or description. If the renderer does not escape values, escape them yourself or wrap the library behind a safe rendering layer.
- Can it handle multiple Open Graph images and structured properties like og:image:width?
- Yes, it can accumulate array-valued properties, including multiple images with og:image:width and og:image:height sub-properties. Whether repeated keys are deduplicated automatically should be verified in a spike, because that behavior is not confirmed and may be the caller's responsibility. For article metadata, build the structured properties your pages need and test the generated tags.
- Does chriskonnertz/open-graph support Twitter/X cards, og:image:alt, or JSON-LD?
- There is no evidence that the package covers Twitter/X card tags, og:image:alt, JSON-LD, or locale alternates. Treat it as an og:-only property builder and plan to extend or wrap it for those requirements. Extending an unmaintained 2019-era library may effectively mean forking it under your own namespace.
- How do I render Open Graph meta tags in Blade with this package?
- Build the Open Graph object in a presenter, controller, or dedicated App\Seo class, then echo its rendered output from a Blade component or layout partial. Avoid calling the library directly from many Blade templates or controllers, because that coupling makes a later swap expensive. A thin adapter keeps the 2019-era package behind an interface you control.
- Does chriskonnertz/open-graph resolve relative image URLs to absolute URLs?
- The package likely emits image URLs verbatim and does not resolve relative paths against APP_URL, so verify this before relying on it. Relative og:image values are a common cause of failed Facebook Sharing Debugger previews. Resolve images to absolute URLs in your adapter before passing them to the library.
- Is chriskonnertz/open-graph maintained and should I use it in production?
- The last tagged release is June 2019, so abandonment is a high risk: there is no PHP 8.x CI matrix, no spec updates, and no obvious security response path. The upside is a tiny, dependency-free codebase with effectively zero transitive supply-chain surface. For production, consider using it as a reference implementation or forking the few hundred lines under your own namespace rather than adopting it as a long-term dependency.
- What are alternatives to chriskonnertz/open-graph for Laravel SEO meta tags?
- Alternatives include writing a small internal Open Graph builder, using a maintained Laravel SEO or meta-tag package that covers Open Graph and Twitter cards, or forking this library. Compare maintenance status, PHP 8 support, escaping behavior, and structured-property coverage before choosing. Because the core capability is small, owning the code can be cheaper than adapting around a stale package.
- How can I test Open Graph output from this package in Laravel?
- Add unit tests around your adapter that assert the generated meta property and content attributes for titles, descriptions, images, and multiple-image sub-properties. Include an XSS payload test to confirm escaping, and a deduplication test if your pages can set the same property twice. In Laravel feature tests, assert the rendered HTML contains the expected og: tags.