PHPackages                             lukaswhite/php-feed-writer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lukaswhite/php-feed-writer

ActiveProject[Utility &amp; Helpers](/categories/utility)

lukaswhite/php-feed-writer
==========================

A PHP library for writing feeds; e.g. RSS

2.1(3y ago)929.3k↓33.3%5[1 issues](https://github.com/lukaswhite/php-feed-writer/issues)[1 PRs](https://github.com/lukaswhite/php-feed-writer/pulls)1MITPHPPHP &gt;=8.0.0CI failing

Since Sep 25Pushed 3y ago2 watchersCompare

[ Source](https://github.com/lukaswhite/php-feed-writer)[ Packagist](https://packagist.org/packages/lukaswhite/php-feed-writer)[ RSS](/packages/lukaswhite-php-feed-writer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (10)Used By (1)

Feed Writer
===========

[](#feed-writer)

[![PHP Feed Writer](https://camo.githubusercontent.com/3a75f6fa09fcaa0670cad408dd24376cdcfb806d58966ba7664dabfe54c9cf91/68747470733a2f2f6c756b617377686974652e6769746875622e696f2f7068702d666565642d7772697465722f6173736574732f7068702d666565642d7772697465722e737667)](https://camo.githubusercontent.com/3a75f6fa09fcaa0670cad408dd24376cdcfb806d58966ba7664dabfe54c9cf91/68747470733a2f2f6c756b617377686974652e6769746875622e696f2f7068702d666565642d7772697465722f6173736574732f7068702d666565642d7772697465722e737667)

A PHP library for writing feeds. Currently supports RSS 2.0, Atom and iTunes, along with support for MediaRSS, Dublin Core, GeoRSS and WordPress eXtended RSS (WXR).

[![Build Status](https://camo.githubusercontent.com/a62cb85526d3748c220873cafc35bcd449c878a548636c975f87496540b50106/68747470733a2f2f7472617669732d63692e6f72672f6c756b617377686974652f7068702d666565642d7772697465722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/lukaswhite/php-feed-writer)

[![Codacy Badge](https://camo.githubusercontent.com/04d637c60d853c0e6d359a99384a3a20a954fa19a030a0646b87613366a6443c/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3361383562623865663061663436343338326662386163616539613662643535)](https://www.codacy.com/app/lukaswhite/php-feed-writer?utm_source=github.com&utm_medium=referral&utm_content=lukaswhite/php-feed-writer&utm_campaign=Badge_Grade)

Features
--------

[](#features)

- Modern (PHP7.1+)
- Flexible; use it for syndication, media, podcasts...
- Fast
- Easy to extend
- Supports custom namespaces
- Full MediaRSS support
- Dublin Core Support
- GeoRSS support
- Supports XSL stylesheets
- No third-party dependencies
- Fully tested

Simple Examples
---------------

[](#simple-examples)

### RSS

[](#rss)

```
$feed = new RSS2( );

$channel = $feed->addChannel( );

$channel
	->title( 'My Blog' )
	->description( 'My personal blog' )
	->link( 'https://example.com' )
	->lastBuildDate( new \DateTime( ) )
	->pubDate( new \DateTime( ) )
	->language( 'en-US' );

foreach( $posts as $post ) {
	$channel->addItem( )
		->title( $post->title )
		->description( $post->description )
		->link( $post->url )
		->pubDate( $post->publishedAt )
		->guid( $post->url, true );
}
```

### RSS in Laravel

[](#rss-in-laravel)

```
$feed = new RSS2( );

// ...

return response( )->make(
	$feed->toString( ),
	200,
	[
		'Content-Type' => $feed->getMimeType( ),
	]
);
```

### Atom

[](#atom)

```
$feed = new \Lukaswhite\FeedWriter\Atom( );

$feed->title( 'Example Feed' )
	->link( 'http://example.org/' )
	->updated( new \DateTime( '2003-12-13T18:30:02Z' ) )
	->id( 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6' );

foreach( $posts as $post ) {
	$feed->addEntry( )
		->title( $post->title )
		->id( $post->id )
		->updated( $post->updatedAt );
}
```

### iTunes

[](#itunes)

```
$feed = new Itunes( );

$channel = $feed->addChannel( );

$channel->title( 'All About Everything' )
    ->subtitle( 'A show about everything' )
    ->description( 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store' )
    ->summary( 'All About Everything is a show about everything. Each week we dive into any subject known to man and talk about it as much as we can. Look for our podcast in the Podcasts app or in the iTunes Store' )
    ->link( 'http://www.example.com/podcasts/everything/index.html' )
    ->image( 'http://example.com/podcasts/everything/AllAboutEverything.jpg' )
    ->author( 'John Doe' )
    ->owner( 'John Doe', 'john.doe@example.com' )
    ->explicit( 'no' )
    ->copyright( '&#x2117; &amp; &#xA9; 2014 John Doe &amp; Family' )
    ->generator( 'Feed Writer' )
    ->ttl( 60 )
    ->lastBuildDate( new \DateTime( '2016-03-10 02:00' ) );

$channel->addCategory()
    ->term('Technology');

$channel->addCategory()
    ->term('Sports')
    ->children('Football', 'Soccer');

$channel->addItem( )
    ->title( 'Shake Shake Shake Your Spices' )
    ->author( 'John Doe' )
    ->subtitle( 'A short primer on table spices' )
    ->duration( '07:04' )
    ->summary( 'This week we talk about salt and pepper shakers, comparing and contrasting pour rates, construction materials, and overall aesthetics. Come and join the party!' )
    ->pubDate( new \DateTime( '2016-03-08 12:00' ) )
    ->guid( 'http://example.com/podcasts/archive/aae20140615.m4a' )
    ->explicit( 'no' )
    ->addEnclosure( )
        ->url( 'http://example.com/podcasts/everything/AllAboutEverythingEpisode3.m4a' )
        ->length( 8727310 )
        ->type( 'audio/x-m4a' );
```

Installation
------------

[](#installation)

This package requires PHP 7.1+.

Install the package using [Composer](https://getcomposer.org/):

```
composer require lukaswhite\php-feed-writer

```

Documentation
-------------

[](#documentation)

Full documentation [can be found here](https://lukaswhite.github.io/php-feed-writer).

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~199 days

Recently: every ~150 days

Total

8

Last Release

1392d ago

Major Versions

0.2.0 → 1.0.02019-04-07

1.3.0 → 2.02021-05-22

PHP version history (2 changes)0.0.1PHP &gt;=7.0.0

2.0PHP &gt;=8.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1bd633ffdf0f66a73a288c4edcacfa43d214cd95a53384c6fe5ea4b3554dd9d?d=identicon)[lukaswhite](/maintainers/lukaswhite)

---

Top Contributors

[![lukaswhite](https://avatars.githubusercontent.com/u/999014?v=4)](https://github.com/lukaswhite "lukaswhite (44 commits)")

---

Tags

atomfeedsgeorssitunesmediarssphprssspotifysyndication

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/lukaswhite-php-feed-writer/health.svg)

```
[![Health](https://phpackages.com/badges/lukaswhite-php-feed-writer/health.svg)](https://phpackages.com/packages/lukaswhite-php-feed-writer)
```

###  Alternatives

[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
