This Nova tool adds a Spotify auth section to the Nova Sidebar. Under the hood it uses the mgoigfer/laravel-spotify-wrapper package.
You can authenticate yourself through Spotify API and store a refresh token to your database.
-
You must install mgoigfer/laravel-spotify-wrapper into your Laravel app.
-
You can install this package via Composer:
composer require mgoigfer/nova-spotify-auth-tool
- Register the tool in
app/Providers/NovaServiceProvider
:
public function tools()
{
return [
new \Mgoigfer\SpotifyAuthTool\SpotifyAuthTool,
];
}
- Publish and run the application migrations:
php artisan vendor:publish --provider="Mgoigfer\SpotifyAuthTool\SpotifyAuthToolServiceProvider"
php artisan migrate
- Register the following redirect URI in your Spotify app:
<APP_URL>/nova-vendor/nova-spotify-auth-tool/auth
To get the Spotify user ID and the refresh token stored in the database:
use Mgoigfer\SpotifyAuthTool\Facades\Spotify;
$userId = Spotify::userId();
$refreshToken = Spotify::refreshToken();
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.