PHP code example of torann / podcastfeed
1. Go to this page and download the library: Download torann/podcastfeed library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
torann / podcastfeed example snippets
'providers' => [
...
Torann\PodcastFeed\PodcastFeedServiceProvider::class,
...
]
'aliases' => [
...
'PodcastFeed' => Torann\PodcastFeed\Facades\PodcastFeed::class,
...
];
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' => '[email protected] ',
'category' => 'Technology',
'language' => 'en-us',
'copyright' => '2016 John Doe & Family',
]);
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(),
]);
}
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');
}
$ php artisan vendor:publish --provider="Torann\PodcastFeed\PodcastFeedServiceProvider"