This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Laravel\Socialite\Two\AbstractProvider; | |
use Laravel\Socialite\Two\ProviderInterface; | |
use Laravel\Socialite\Two\User; | |
class SpotifyProvider extends AbstractProvider implements ProviderInterface { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace FestivalPlaylists\Oauth; | |
use Laravel\Socialite\Two\AbstractProvider; | |
use Laravel\Socialite\Two\ProviderInterface; | |
use Laravel\Socialite\Two\User; | |
class SpotifyProvider extends AbstractProvider implements ProviderInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scopes | |
* | |
* @var string | |
*/ | |
const SCOPE_PLAYLIST_MODIFY_PUBLIC = 'playlist-modify-public'; | |
const SCOPE_PLAYLIST_MODIFY_PRIVATE = 'playlist-modify-private'; | |
const SCOPE_PLAYLIST_READ_PRIVATE = 'playlist-read-private'; | |
const SCOPE_STREAMING = 'streaming'; | |
const SCOPE_USER_LIBRARY_MODIFY = 'user-library-modify'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return [ | |
'spotify' => [ | |
'client_id' => 'CLIENT_ID_STR', | |
'client_secret' => 'CLIENT_SEC_STR', | |
'redirect' => getenv('URL') . '/login' | |
] | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function bootSpotifySocialite() | |
{ | |
$socialite = $this->app->make('Laravel\Socialite\Contracts\Factory'); | |
$socialite->extend( | |
'spotify', | |
function ($app) use ($socialite) { | |
$config = $app['config']['services.spotify']; | |
return $socialite->buildProvider(SpotifyProvider::class, $config); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function redirectToProvider() | |
{ | |
return Socialize::with('spotify')->redirect(); | |
} | |
public function handleProviderCallback() | |
{ | |
$user = Socialize::with('spotify')->user(); | |
// $user->token; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$router->get('login', ['as' => 'login', 'uses' => 'SpotifyAuthController@redirectToProvider']); | |
$router->get('login_callback', ['as' => 'login', 'uses' => 'SpotifyAuthController@handleProviderCallback']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
elixir(function(imix) { | |
// Workflow stuff | |
imix.sass('app.scss') | |
.coffee() | |
.phpUnit() | |
.wiredep(); | |
// Build stuff | |
if (elixir.config.production) { | |
imix.stylesIn('public/css') | |
.scriptsIn('public/js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ( Config::get('app.debug') ) | |
<link rel="stylesheet" href="bower_components/dropzone/dist/min/dropzone.min.css" /> | |
<link rel="stylesheet" href="css/app.css" /> | |
@else | |
<link rel="stylesheet" href="{{ elixir("css/all.css") }}"> | |
@endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- bower:css --> | |
<link rel="stylesheet" href="bower_components/dropzone/dist/min/dropzone.min.css" /> | |
<link rel="stylesheet" href="css/app.css" /> | |
<!-- endbower --> |
OlderNewer