This tile displays "now playing" infomation from spotify.
This tile can be used on the Laravel Dashboard.
You can install the package via composer:
composer require ashbakernz/laravel-dashboard-spotify-tileIn the dashboard config file, you must add this configuration in the tiles key.
'spotify' => [
'client_id' => env('SPOTIFY_CLIENT_ID'),
'secret' => env('SPOTIFY_SECRET'),
'refresh_interval_in_seconds' => 60,
]Sign up at https://developer.spotify.com/dashboard and register your application to obtain SPOTIFY_CLIENT_ID and SPOTIFY_SECRET.
Once you have setup your application please go to the spotify dashboard, select your application and click "EDIT SETTINGS" in the top right. You will then need to add the following urls based on your environments to the "Redirect URIs " section and then hit save. This will allow us to authenticate correctly in the next step.
Redirect URI example:
https://yourdomain.com/spotify/callbackIn your dashboard view you use the livewire:spotify-tile component.
<x-dashboard>
<livewire:spotify-tile position="a1:a1" />
</x-dashboard>Once this is complete please head to the /spotify/authorize route on your dashboard in a browser and this will allow you to authenicate your spotify account.
In app\Console\Kernel.php you should schedule the following commands.
protected function schedule(Schedule $schedule)
{
// ...
$schedule->command(\Ashbakernz\SpotifyTile\FetchDataFromSpotifyCommand::class)->everyMinute();
$schedule->command(\Ashbakernz\SpotifyTile\RefreshAccessTokenSpotifyCommand::class)->everyFifteenMinutes();
}Setup is complete!
If the tile is displaying incorrectly please head to the /spotify/refresh route in a browser to refresh your spotify access token manually. (a command is already setup to do this every 30 mins via scheduler)
composer testPlease see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email ashbakernz@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
