ejdelmonico / LaravelRSSFeed by ejdelmonico

A simple Laravel 5 wrapper around SimplePie to pull in RSS feeds
127
0
2
Package Data
Maintainer Username: ejdelmonico
Maintainer Contact: ejdelmonico@gmail.com (E J Del Monico)
Package Create Date: 2016-10-30
Package Last Update: 2017-11-27
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-22 03:09:02
Package Statistics
Total Downloads: 127
Monthly Downloads: 2
Daily Downloads: 0
Total Stars: 0
Total Watchers: 2
Total Forks: 0
Total Open Issues: 0

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.