ejdelmonico/laravel-rss-feed

A simple Laravel 5 wrapper around SimplePie to pull in RSS feeds
129
Install
composer require ejdelmonico/laravel-rss-feed
Latest Version:v1.0.4
PHP:>=7.0
License:MIT
Last Updated:Nov 27, 2017
Links: GitHub  ·  Packagist
Maintainer: ejdelmonico

Laravel RSS Feed Parser

Latest Version on Packagist Software License Build Status Quality Score StyleCI Status Total Downloads

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.