- How do I install j0k3r/graby in a Laravel application?
- Install it with Composer using j0k3r/graby plus an HTTP adapter such as php-http/guzzle7-adapter. Pin the package to ^2.5.3 or >=2.5.3 so the security fix cannot be rolled back by a lockfile change. Ensure the PHP Tidy and cURL extensions are enabled in your local, CI, and production environments.
- Does Graby support Laravel 10, Laravel 11, and PHP 8.2?
- Graby requires PHP 8.2 or newer, and Laravel 10 and later support PHP 8.2, so modern Laravel applications are a good fit. Use Graby 2.x with a Guzzle 7 adapter for current stacks; older Guzzle 6 setups are only relevant for legacy applications. Confirm your deployment image includes Tidy and cURL before relying on extraction in production.
- How should I use Graby with Laravel queues and caching?
- Treat Graby content extraction as an HTTP-heavy job and run it through Laravel Queues so user requests do not time out. Cache extracted payloads with Cache::remember() and sensible TTLs to avoid repeatedly fetching and parsing the same URLs. This pattern works well for RSS-to-full-text pipelines, aggregators, and batch scraping workflows.
- How do I configure the Guzzle HTTP adapter for Graby in Laravel?
- Graby is decoupled through HTTPlug, so you can wire it to Laravel's Guzzle 7 client using php-http/guzzle7-adapter. This avoids vendor lock-in and lets you keep HTTP client configuration, middleware, timeouts, and proxies in one place. You can also pass pre-fetched HTML to Graby for offline processing or when another service already retrieved the page.
- Can Graby extract full article content from RSS feeds and user-submitted URLs?
- Yes, Graby is designed to extract article content from web pages, making it suitable for RSS-to-full-text pipelines and URL submission workflows. It returns structured extraction data such as title, summary, images, and metadata from unstructured HTML. For untrusted user-submitted URLs, combine it with validation, outbound request controls, and queue-based processing.
- How do I handle Graby extraction failures in Laravel?
- Graby generally degrades gracefully by returning structured error information rather than throwing hard exceptions, which fits Laravel's exception-handling conventions. Capture failures in logs, dispatch events such as extraction failed or content extracted, and retry through queued jobs with backoff where appropriate. Store failed URLs and error details so you can review problematic domains and update site-specific rules.
- Does Graby support site-specific extraction rules and custom configuration?
- Graby uses FiveFilters site_config patterns to improve extraction for specific websites and supports custom filters for domain-specific needs. Maintain your site_config directory in version control so changes are reviewed and deployable across environments. This is useful for news sites, paywalled sources, and domains with unusual markup, though JavaScript-heavy pages may still need a headless browser or pre-fetched HTML.
- Is j0k3r/graby safe to use in production after the security advisory?
- The 2.5.3 release addresses advisory GHSA-hj75-9vmq-m8hm, so upgrade to 2.5.3 or later immediately if you are on 2.5.0 through 2.5.2. The advisory's exact affected code path is not detailed in the changelog, so treat it as an upgrade-mandatory event and run composer audit in CI. If you processed untrusted user-supplied URLs on affected versions, review logs for anomalous outbound requests and assess exposure.
- What are alternatives to Graby for content extraction in Laravel?
- Alternatives include running Full-Text RSS as a standalone service, Readability.php-based extraction, or other article parser libraries depending on your needs. Graby's advantages are Composer integration, test coverage, decoupled HTTP handling, and site_config support. Evaluate alternatives against your requirements for JavaScript rendering, maintenance, licensing, and Laravel queue integration.
- How do I test and maintain Graby in a Laravel CI pipeline?
- Run composer audit in CI, keep the Graby constraint at ^2.5.3 or higher, and verify no transitive dependency pins you to an affected 2.5.x release. Test extraction using fixture HTML and pre-fetched content so tests do not depend on live websites. For maintenance, version-control site_config rules, monitor minor releases, and budget for routine patch upgrades.