Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Morris morrislaptop

View GitHub Profile
View gist.php
public function redirectToProvider()
{
return Socialize::with('spotify')->redirect();
}
public function handleProviderCallback()
{
$user = Socialize::with('spotify')->user();
// $user->token;
View gist.php
<?php namespace FestivalPlaylists\Bridges;
use Laracasts\Flash\FlashServiceProvider as BaseFlashServiceProvider;
class FlashServiceProvider extends BaseFlashServiceProvider {
var $namespace = 'flash';
var $vendor = 'laracasts';
use LaravelFivePackageTrait;
View gist.php
$router->get('login', ['as' => 'login', 'uses' => 'SpotifyAuthController@redirectToProvider']);
$router->get('login_callback', ['as' => 'login', 'uses' => 'SpotifyAuthController@handleProviderCallback']);
View gist.php
<?php
use Laravel\Socialite\Two\AbstractProvider;
use Laravel\Socialite\Two\ProviderInterface;
use Laravel\Socialite\Two\User;
class SpotifyProvider extends AbstractProvider implements ProviderInterface {
}
View gist.js
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')
View gist.php
<?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
View gist.blade.php
@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
View gist.php
/**
* 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';
View gist.html
<!-- bower:css -->
<link rel="stylesheet" href="bower_components/dropzone/dist/min/dropzone.min.css" />
<link rel="stylesheet" href="css/app.css" />
<!-- endbower -->
View gist.php
return [
'spotify' => [
'client_id' => 'CLIENT_ID_STR',
'client_secret' => 'CLIENT_SEC_STR',
'redirect' => getenv('URL') . '/login'
]
];