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.
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>
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,
]
],
];
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"
Please see the changelog for more information on what has changed recently.
$ composer test
Please see contributing.md for details and a todolist.
If you discover any security related issues, please email author email instead of using the issue tracker.
- spatie/laravel-dashboard create beautiful dashboards
- willvincent/feeds A Laravel service provider for including the SimplePie library.
- simplepie/simplepie RSS and Atom feed parsing in PHP.
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.
Please see the license file for more information.