2017 © Pedro Peláez
 

library feeds

Laravel 5 Service Provider for the SimplePie library

image

willvincent/feeds

Laravel 5 Service Provider for the SimplePie library

  • Thursday, July 19, 2018
  • by willvincent
  • Repository
  • 15 Watchers
  • 161 Stars
  • 127,021 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 46 Forks
  • 1 Open issues
  • 13 Versions
  • 12 % Grown

The README.md

Laravel Feeds

Latest Stable Version SensioLabsInsight License, (*1)

Total Downloads Monthly Downloads Daily Downloads, (*2)

A simple Laravel 5/6/7/8/9/10 service provider for including the SimplePie library., (*3)

Installation

The Laravel 5/6/7/8/9/10 Feeds Service Provider can be installed via Composer by requiring the willvincent/feeds package in your project's composer.json., (*4)

{
    "require": {
        "willvincent/feeds": "2.3.*"
    }
}

Configuration

If you're using Laravel 5.5 or newer you may skip the next step., (*5)

To use the Feeds Service Provider, you must register the provider when bootstrapping your Laravel application., (*6)

Find the providers key in your config/app.php and register the Service Provider., (*7)

    'providers' => [
        // ...
        willvincent\Feeds\FeedsServiceProvider::class,
    ],

Find the aliases key in your config/app.php and register the Facade., (*8)

    'aliases' => [
        // ...
        'Feeds'    => willvincent\Feeds\Facades\FeedsFacade::class,
    ],

Usage

Run php artisan vendor:publish --provider="willvincent\Feeds\FeedsServiceProvider" to publish the default config file, edit caching setting withing the resulting config/feeds.php file as desired., (*9)

See SimplePie Documentation for full API usage documentation., (*10)

The make() accepts 3 paramaters, the first parameter is an array of feed URLs, the second parameter is the max number of items to be returned per feed, and while the third parameter is a boolean which you can set to force to read unless content type not a valid RSS., (*11)

$feed = \Feeds::make('http://feed/url/goes/here');
Note: In Laravel 5 and newer, Facades must either be prefixed with a backslash, or brought into scope with a use [facadeName] declaration.

Controller:, (*12)

  public function demo() {
    $feed = \Feeds::make('http://blog.case.edu/news/feed.atom');
    $data = array(
      'title'     => $feed->get_title(),
      'permalink' => $feed->get_permalink(),
      'items'     => $feed->get_items(),
    );

    return View::make('feed', $data);
  }

or Force to read unless content type not a valid RSS, (*13)

  public function demo() {
    $feed = \Feeds::make('http://blog.case.edu/news/feed.atom', true); // if RSS Feed has invalid mime types, force to read
    $data = array(
      'title'     => $feed->get_title(),
      'permalink' => $feed->get_permalink(),
      'items'     => $feed->get_items(),
    );

    return View::make('feed', $data);
  }

Controller:, (*14)

  public function demo() {
    $feed = \Feeds::make([
        'http://blog.case.edu/news/feed.atom',
        'http://tutorialslodge.com/feed'
    ], 5);
    $data = array(
      'title'     => $feed->get_title(),
      'permalink' => $feed->get_permalink(),
      'items'     => $feed->get_items(),
    );

    return View::make('feed', $data);
  }

or Force to read unless content type not a valid RSS, (*15)

  public function demo() {
        $feed = \Feeds::make(['http://blog.case.edu/news/feed.atom',
        'http://tutorialslodge.com/feed'
    ], 5, true); // if RSS Feed has invalid mime types, force to read
    $data = array(
      'title'     => $feed->get_title(),
      'permalink' => $feed->get_permalink(),
      'items'     => $feed->get_items(),
    );

    return View::make('feed', $data);
  }

View:, (*16)

@extends('app')

@section('content')






  @foreach ($items as $item)


{{ $item->get_title() }}

{{ $item->get_description() }}, (*17)

Posted on {{ $item->get_date('j F Y | g:i a') }}, (*18)

@endforeach @endsection

The Versions

19/07 2018

dev-master

9999999-dev

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

19/07 2018

v1.1.5

1.1.5.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

08/02 2018

v1.1.4

1.1.4.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

26/09 2017

v1.1.3

1.1.3.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

25/01 2017

v1.1.2

1.1.2.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

18/10 2016

v1.1.1

1.1.1.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

18/10 2016

v1.1.0

1.1.0.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

19/11 2015

1.0.6

1.0.6.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

27/08 2015

1.0.5

1.0.5.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

06/08 2015

1.0.4

1.0.4.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

23/06 2015

1.0.3

1.0.3.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

09/06 2015

1.0.2

1.0.2.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent

17/02 2015

1.0.1

1.0.1.0

Laravel 5 Service Provider for the SimplePie library

  Sources   Download

MIT

The Requires

 

by Will Vincent