A simple RSS feed reader for Laravel
- One command to read any RSS feed
- Different RSS feed profiles enabled
To install this package run the Composer command
$ composer require vedmant/laravel-feed-reader
For Laravel 5.5 and above this package supports Laravel Auto-Discovery and will be discovered automatically.
For Laravel versions prior to 5.5 follow next guide:
In your config/app.php
add following:
'providers' => [
Illuminate\Foundation\Providers\ArtisanServiceProvider::class,
Illuminate\Auth\AuthServiceProvider::class,
...
Vedmant\FeedReader\FeedReaderServiceProvider::class, // Add this line
[,
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
...
'FeedReader' => Vedmant\FeedReader\Facades\FeedReader::class, // Add this line
],
After installing through composer, you should publish the config file. To do this, run the following command:
$ php artisan vendor:publish --provider="Vedmant\FeedReader\FeedReaderServiceProvider"
Once published, the configuration file contains an array of profiles. These will define how the RSS feed reader will react. By default the "default" profile will used. For more information on: [here]http://simplepie.org/wiki/reference/simplepie/start.
Once you have all of the configuration settings set up, in order to read a RSS feed all you need to do is call the read
function:
FeedReader::read('http://www.example.com/rss');
This function accepts 2 parameters however, the second parameter is optional. The second parameter is the configuration profile that should be used when reading the RSS feed.
This will return to you the SimplePie object with the RSS feed in it.
Feed Reader is free software distributed under the terms of the MIT license
Any issues, please report here