ejdelmonico / laravel-rss-feed
A simple Laravel 5 wrapper around SimplePie to pull in RSS feeds
Installs: 127
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=7.0
- illuminate/contracts: ~5.3.0
- illuminate/support: ~5.3.0
- simplepie/simplepie: 1.4.*
Requires (Dev)
- orchestra/testbench: ~3.3.0
- phpunit/phpunit: 5.*
This package is auto-updated.
Last update: 2024-10-27 04:02:44 UTC
README
This project is crafted for usage in Laravel 5 applications using >= PHP 7. It was inspired by a need to pull in blog posts from a single url to use in Laravel Blade templates.
Installation
The LaravelRSSFeed package is installed by requiring the package in your composer.json
. You can either do it via composer install
composer require ejdelmonico/laravel-rss-feed
or by simply including it.
{
"require": {
"ejdelmonico/laravel-rss-feed": "1.*"
}
}
Configuration
To use the package, you must register the service provider:
// In config/app.php
'providers' => [
// ...
ejdelmonico\LaravelRSSFeed\LaravelRSSFeedServiceProvider::class,
],
'aliases' => [
// ...
'Feed' => ejdelmonico\LaravelRSSFeed\FeedFacade::class,
],
Usage
php artisan vendor:publish --provider="ejdelmonico\LaravelRSSFeed\LaravelRSSFeedServiceProvider" --tag=config
Here is a simple example:
Route::get('feed', function () {
$url = 'https://blog.errordetective.com/rss/';
$rss = Feed::makeRequest($url);
$data = array(
'title' => $rss->feed->get_title(),
'permalink' => $rss->feed->get_permalink(),
'items' => $rss->feed->get_items(),
);
return view('pages.feed', $data);
});
Change log
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING and CONDUCT for details.
Security
If you discover any security related issues, please email ejdelmonico@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.