- How do I install fg/essence in a Laravel app?
- Install it with Composer using composer require fg/essence. The package is described as providing a Laravel facade, service provider, and publishable configuration, so you can register it through Laravel's package discovery or manually in config/app.php. In practice, the technical evaluation recommends binding a configured client in the service container and calling it behind an internal adapter rather than using the facade directly in controllers.
- What Laravel and PHP versions does fg/essence support?
- The provided materials do not list explicit Laravel or PHP version constraints for fg/essence 3.5.4. The technical evaluation says a compatibility spike is still required, including PHP 8.2 and 8.3 checks and a review of transitive dependencies. You should verify the Composer constraints and run the package against your exact Laravel and PHP versions before adopting it.
- How do I configure fg/essence and publish its config?
- fg/essence includes publishable configuration for setting extraction defaults, according to the package overview. Run the package's publish command to copy the config into your Laravel config directory, then adjust defaults as needed. The evaluation notes that HTTP client behavior such as timeouts, redirect limits, user agent, proxy, and TLS verification should be reviewed and configured through your own adapter where possible.
- Can fg/essence generate link previews for YouTube and Vimeo?
- Yes, fg/essence is designed to extract titles, descriptions, images, media URLs, and embeddable content from supported links, including providers such as YouTube and Vimeo. It uses Open Graph, Twitter Cards, oEmbed, and other provider metadata to build rich link previews and media embeds. Release 3.5.4 specifically updates Vimeo oEmbed endpoints to HTTPS, reducing mixed-content risk for Vimeo previews.
- Is fg/essence safe for user-supplied URLs in production?
- The technical evaluation warns that user-supplied URLs create SSRF, DNS rebinding, redirect, and response-size risks unless you add strict URL validation and egress controls. fg/essence fetches external pages and parses untrusted HTML, so it should not be exposed directly to arbitrary URLs without safeguards. Use an allow or deny list, enforce redirect and timeout limits, and run extraction in queued jobs rather than synchronous page renders.
- What license does fg/essence use and can I use it commercially?
- The technical evaluation states that the license remains NOASSERTION, which is a legal gate before adoption. That means you should verify whether the actual license is OSI-approved and compatible with commercial distribution and internal forking. Do not assume commercial usability until your legal or compliance review confirms the license terms.
- Is fg/essence actively maintained?
- Release 3.5.4 shows some upstream maintenance activity, so an earlier concern about a last release in 2021 should be treated as stale. However, the technical evaluation notes that a single Vimeo HTTPS endpoint fix does not establish a reliable security cadence or long-term maintenance commitment. Review the release date, dependency health, composer audit results, and issue activity before relying on it.
- How should I test fg/essence extraction and failure cases?
- The provided materials do not show test coverage for malformed HTML, blocked responses, TLS failures, redirects, or provider failures. You should add your own tests around the adapter, using mocked HTTP responses for supported providers and failure scenarios. Also test fallback behavior, timeout handling, encoding issues, and the normalized preview data your application expects.
- What are alternatives to fg/essence for link previews in Laravel?
- Because fg/essence is framework-agnostic PHP behind a Laravel wrapper, you can replace it with a custom parser, a provider-specific oEmbed client, or another link-preview package. The technical evaluation recommends hiding it behind an interface such as LinkPreviewResolver or EmbedResolver so callers do not depend on Essence directly. That makes it easier to swap implementations if maintenance, licensing, or extraction quality becomes a problem.
- Should I call fg/essence from controllers or queue it?
- The technical evaluation strongly recommends invoking fg/essence from queued jobs, not from request and response cycles. It performs external network I/O and parses untrusted HTML, which can add latency and reliability risk to synchronous page renders. Store normalized preview data in a DTO or cache and return that cached result to the UI, with a placeholder or fallback when extraction fails.