- How do I install rumenx/php-feed in a Laravel project?
- Install it with Composer by running composer require rumenx/php-feed. Because the package is distributed through Composer with PSR-4 autoloading, Laravel's package auto-discovery may register the service provider automatically, but check the extra block in the package's composer.json and add the provider manually to config/bootstrap/providers.php if discovery is not supported. After that you can resolve the generator from the container or instantiate it directly. Pin a caret version constraint and commit your composer.lock so the XML output stays reproducible across deploys.
- Does rumenx/php-feed work outside Laravel, for example in Symfony or a plain PHP script?
- Yes. The package is described as framework-agnostic, so it should work in Symfony applications and in framework-free PHP 8 projects through direct instantiation. In Symfony you can register it as a plain service, or use a bundle if one ships with the package. Before adopting it outside Laravel, inspect the composer.json require block to confirm the core does not pull in illuminate/support transitively, since framework-agnostic packages that secretly depend on a framework are a common failure mode in this category.
- Which feed formats does rumenx/php-feed support: RSS 2.0, Atom 1.0 or JSON Feed?
- The package advertises RSS, Atom and JSON feed generation, plus parsing of existing feeds, along with custom namespaces, enclosures and podcast tags, which are RSS and Atom concepts. Confirm that each format you depend on is actually covered by fixture-based tests in the version you install. Generators can emit subtly invalid XML that aggregators drop without any error, so validate every format you plan to ship against the W3C Feed Validator first.
- What PHP and Laravel versions does rumenx/php-feed require?
- That lives in the package's composer.json require block, so check the PHP floor and any framework constraints before you commit. The technical review flags the support matrix as an open question, so verify whether it tracks current Laravel and Symfony release windows and whether there is a CI matrix covering them. Also check which XML extension it needs, whether ext-dom and ext-xmlwriter or ext-simplexml, because that determines what your production and CI images must install.
- How do I add podcast tags, enclosures or custom XML namespaces to a feed?
- The library advertises first-class support for enclosures, podcast tags and custom namespaces through a fluent, chainable API. In practice you declare the namespace on the channel element and then attach namespaced children to individual items, for example an enclosure with a URL, length and MIME type. Validate the result with a tool that understands the iTunes or media namespace, because namespace mistakes are the most common reason podcast clients silently reject a feed.
- Does rumenx/php-feed support caching generated feeds?
- Yes, caching support is listed as a core feature alongside customizable views. In a Laravel app that usually means rendering the feed to a string, storing it in your cache repository with a TTL, and returning the cached value from the controller or route. Keep the cache key tied to the underlying dataset and pagination state so publishing a new article or episode invalidates the feed instead of serving stale content.
- Is rumenx/php-feed ready for production use?
- Treat it as promising but unvalidated. At review time it had a modest star count and no dependents, meaning no downstream project had exercised its API surface in anger, and it is a single-maintainer, MIT-licensed package. The MIT license caps your downside because you can fork and patch it, but you should own that risk explicitly. Put it behind your own FeedGenerator interface and validate real output before relying on it in production.
- How do I test that a feed generated with rumenx/php-feed is valid?
- Use golden-file tests: generate a feed from a fixed fixture dataset, store the expected XML in the repository, and diff it on every run so regressions are obvious. Then run both RSS 2.0 and Atom 1.0 output through the W3C Feed Validator to catch escaping, date formatting and namespacing errors. Add targeted assertions for RFC 3339 timestamps, control-character stripping and CDATA handling, since these are the failures that consumers swallow silently.
- How does rumenx/php-feed compare to spatie/laravel-feed or other Laravel feed packages?
- The main difference is scope. rumenx/php-feed is framework-agnostic, so the same code path can serve Laravel, Symfony and plain PHP services, whereas Laravel-only packages are typically more tightly coupled to Eloquent models and Blade views. That portability pays off if you run multiple applications or expect to move services between frameworks. Compare dependency weight, PHP version floors and test coverage rather than feature lists, and pick whichever you can swap out behind your own FeedGenerator interface.
- Does rumenx/php-feed use XMLWriter or build feed XML with string concatenation?
- The package should rely on PHP's XML extensions such as XMLWriter or DOM rather than string concatenation, but confirm this in the source before adopting it, because hand-built strings are where escaping and CDATA bugs come from. The technical review treats string concatenation as a hard stop for that reason. Also verify that titles, descriptions and links are escaped on output, since unescaped values are a stored-XSS vector for any consumer that renders the feed as HTML.