2017 © Pedro Peláez
 

library podcastfeed

Generate RSS feeds for podcasts in Laravel 5.

image

torann/podcastfeed

Generate RSS feeds for podcasts in Laravel 5.

  • Tuesday, May 29, 2018
  • by torann
  • Repository
  • 1 Watchers
  • 22 Stars
  • 461 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 15 Forks
  • 7 Open issues
  • 7 Versions
  • 3 % Grown

The README.md

Podcast Generator for Laravel

Generate a RSS feed for podcast for Laravel 5., (*1)

Installation

From the command line run, (*2)

$ composer require torann/podcastfeed

Setup

Once installed you need to register the service provider with the application. Open up config/app.php and find the providers key., (*3)

'providers' => [
    ...

    Torann\PodcastFeed\PodcastFeedServiceProvider::class,

    ...
]

This package also comes with a facade, which provides an easy way to call the the class. Open up config/app.php and find the aliases key, (*4)

'aliases' => [
    ...

    'PodcastFeed' => Torann\PodcastFeed\Facades\PodcastFeed::class,

    ...
];

Publish the configurations

Run this on the command line from the root of your project:, (*5)

$ php artisan vendor:publish --provider="Torann\PodcastFeed\PodcastFeedServiceProvider"

A configuration file will be publish to config/podcast-feed.php., (*6)

Methods

setHeader The header of the feed can be set in the config file or manually using the setHeader method:, (*7)

PodcastFeed::setHeader([
    'title'       => 'All About Everything',
    'subtitle'    => 'A show about everything',
    'description' => 'Great site description',
    'link'        => 'http://www.example.com/podcasts/everything/index.html',
    'image'       => 'http://example.com/podcasts/everything/AllAboutEverything.jpg',
    'author'      => 'John Doe',
    'email'       => 'john.doe@example.com',
    'category'    => 'Technology',
    'language'    => 'en-us',
    'copyright'   => '2016 John Doe & Family',
]);

addMedia Adding media to the feed., (*8)

foreach($this->podcastRepository->getPublished() as $podcast)
{
    PodcastFeed::addMedia([
        'title'       => $podcast->title,
        'description' => $podcast->title,
        'publish_at'  => $podcast->publish_at,
        'guid'        => route('podcast.show', $podcast->slug),
        'url'         => $podcast->media->url(),
        'type'        => $podcast->media_content_type,
        'duration'    => $podcast->duration,
        'image'       => $podcast->image->url(),
    ]);
}

toString Converting feed to a presentable string. The example below was pulled from a controller. In theory you could implement a caching method so that it doesn't have to render each time., (*9)

public function index()
{
    foreach($this->podcastRepository->getPublished() as $podcast) {
        PodcastFeed::addMedia([
            'title'       => $podcast->title,
            'description' => $podcast->title,
            'publish_at'  => $podcast->publish_at,
            'guid'        => route('podcast.show', $podcast->slug),
            'url'         => $podcast->media->url(),
            'type'        => $podcast->media_content_type,
            'duration'    => $podcast->duration,
            'image'       => $podcast->image->url(),
        ]);
    }

    return Response::make(PodcastFeed::toString())
        ->header('Content-Type', 'text/xml');
}

Change Log

v0.2.1

  • Fixes foreign characters like 'æ', 'ø' and 'å'

v0.2.0

  • Support Laravel 5

v0.1.0

  • First release

The Versions

29/05 2018

dev-master

9999999-dev

Generate RSS feeds for podcasts in Laravel 5.

  Sources   Download

BSD-2-Clause BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

01/09 2016

0.2.2

0.2.2.0

Generate RSS feeds for podcasts in Laravel 5.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

22/03 2016

0.2.1

0.2.1.0

Generate RSS feeds for podcasts in Laravel 5.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

28/01 2016

0.2.0

0.2.0.0

Generate RSS feeds for podcasts in Laravel 5.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

28/01 2016

dev-laravel-4

dev-laravel-4

Generate RSS feeds for podcasts in Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

28/01 2016

0.1.1

0.1.1.0

Generate RSS feeds for podcasts in Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator

24/02 2015

0.1.0

0.1.0.0

Generate RSS feeds for podcasts in Laravel.

  Sources   Download

BSD 2-Clause

The Requires

 

laravel xml feed rss podcast podcast generator