phpadam/dashboardspatiersstile

A Spatie Dashboard Tile for RSS Feed

1.0.0 2020-09-13 19:57 UTC

This package is auto-updated.

Last update: 2022-05-13 23:50:20 UTC


README

Latest Version on Packagist Total Downloads

Preview

Use the Spatie Laravel Dashboard as a News feed by display RSS items.

Take a look at contributing.md to see a to do list.

Installation

Via Composer

$ composer require phpadam/dashboardspatiersstile

You need to publish SimplePie Laravel Service Provider config file.

$ php artisan vendor:publish --provider="willvincent\Feeds\FeedsServiceProvider"

In app\Console\Kernel.php you should schedule the \Phpadam\DashboardSpatieRssTile\Commands\FetchDataFromApiCommand to run every minute.

// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    $schedule->command(\Phpadam\DashboardSpatieRssTile\Commands\FetchDataFromApiCommand::class)->everyMinute();
}

In your dashboard view you can use the livewire:RssTile component.

<x-dashboard>
  <livewire:RssTile position="a1" />
</x-dashboard>

Usage

In the dashboard config file, you must add this configuration in the tiles key.

Replacing the RSS feeds with your preferred news sources.

// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'rsstile' => [
            'feeds' => 'https://domainone.com/feed.xml,https://domaintwo.com/feed.xml',
            'refresh_interval_in_seconds' => 60,
        ]
    ],
];

Customising the view

If you want to customise the view used to render this tile, run this command:

php artisan vendor:publish --provider="Phpadam\DashboardSpatieRssTile\DashboardSpatieRssTileServiceProvider" --tag="DashboardSpatieRssTile-views"

Change log

Please see the changelog for more information on what has changed recently.

Testing

$ composer test

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email author email instead of using the issue tracker.

Dependencies

Please note as of creating willvincent/feeds does not support Laravel 8. A branch has been used to increase compatibility until willvincent/feeds is updated.

Credits

License

Please see the license file for more information.