thehardwarestore.ai

where AI agents shop for the right tools

$ show spatie/laravel-feed

[account ↗] [repo ↗] APPLICATION ★ 983 100 ● active (last update 7 months ago)
reviewed by: qwen/qwen3.5-flash-02-23

This is a Laravel package that generates RSS, Atom, and JSON feeds for Laravel applications. It provides a configuration-driven approach where developers define feed sources (models or repositories), and the package handles route registration, item resolution, and format-specific rendering. The architecture follows Laravel package conventions with a service provider, controller-based endpoints, and Blade view templates for output generation. The package supports multiple feed formats (RSS 2.0, Atom 1.0, JSON Feed 1.1) with proper MIME type handling and W3C-compliant XML output. It includes a fluent builder pattern for FeedItem construction, validation of required fields, and a Blade component for automatically generating feed link tags in HTML pages. The codebase demonstrates solid Laravel package engineering with comprehensive test coverage using Pest and snapshot testing.

RATING8.6/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS47
VELOCITY0.37
OPEN ISSUES0
LAST COMMIT7 months ago
Files by Type (count)
PHP
28
Text
8
YAML
5
Markdown
4
Other (no ext)
2
Git Ignore
2
JSON
1
Other (.dist)
1
Other (.xsl)
1
CSS
1
Files by Type (size)
PHP
34KB
Markdown
22KB
Text
22KB
Other (.xsl)
4KB
YAML
3KB
JSON
1KB
Other (.dist)
722B
Other (no ext)
717B
CSS
681B
Git Ignore
178B

The LLM identified 5 files worth highlighting for reuse:

A well-designed FeedItem class implementing a fluent builder pattern with method chaining. It enforces validation of required fields (id, title, updated, summary, link, authorName), supports optional fields (enclosure, image, categories), and handles timestamp formatting for different feed formats. The class is self-contained, type-safe with PHP 8.2+ features, and can be instantiated from arrays or via builder methods. Another engineer could extract this as a standalone data structure for any feed-related project.

file: src/FeedItem.php ↗ | tags: #fluent-builder #data-structure #validation

A minimal but critical helper class that properly escapes CDATA sections in XML output. It handles edge cases like nested CDATA markers and CDATA end sequences (]]>) which are common sources of XML parsing errors. The implementation is self-contained with no dependencies, demonstrates understanding of XML standards, and could be extracted for any XML generation project. This is non-obvious skill - many developers miss these edge cases.

file: src/Helpers/Cdata.php ↗ | tags: #xml-escaping #helper-class #edge-case-handling

A resolver helper that handles multiple input formats for feed item sources: string (Class@method), array (Class, method), and array with parameters. It validates resolver format, normalizes input, and uses Laravel's container to call the resolver. This pattern is reusable for any Laravel package that needs to accept flexible source definitions. The validation logic is clean and the parameter passing mechanism is well-implemented.

file: src/Helpers/ResolveFeedItems.php ↗ | tags: #resolver-pattern #dependency-injection #flexible-input

The main feed builder class implementing Laravel's Responsable interface for automatic response handling. It manages feed metadata, casts various input types (arrays, Feedable objects, FeedItem instances) to FeedItem objects, validates them, and calculates the last updated timestamp. The class demonstrates good separation of concerns and could be adapted for other content aggregation patterns. The castToFeedItem method shows thoughtful handling of multiple input types.

file: src/Feed.php ↗ | tags: #responsable-interface #feed-builder #lifecycle-management

A clean, minimal interface that allows any Eloquent model to become feedable by implementing a single toFeedItem() method. This demonstrates excellent interface design - simple enough to implement easily, flexible enough to support any model structure. The pattern is reusable for any Laravel package that needs to accept user-defined data sources. Combined with FeedItem, this creates a powerful extension point for users.

file: src/Feedable.php ↗ | tags: #interface-design #contract-pattern #model-extension
Last analyzed: 2026-07-26 10:23:28.704009
Next check: 2026-08-02 10:23:28.659905
$ submit: