Laravel 5.4 - 社交网络提供商使用Twitter进行多种配置

时间:2017-07-06 09:23:57

标签: twitter laravel-5.4 laravel-socialite

我有两个与Socialite Provider连接的服务:

$dest = imagecreatefrompng('https://blzgdapipro-a.akamaihd.net/hero/ana/career-portrait.png');
$src = imagecreatefrompng('https://blzgdapipro-a.akamaihd.net/game/rank-icons/season-2/rank-6.png');

$dest2 = imagescale($dest, 396);
imagealphablending($dest2, false);
imagesavealpha($dest2, true);
$src2 = imagescale($src, 79);

imagecopy($dest2, $src2, 0, 0, 0, 0, 79, 79);

header('Content-Type: image/png');
imagepng($dest2);

imagedestroy($dest);
imagedestroy($src);
imagedestroy($dest2);
imagedestroy($src2);

但是,当我尝试这段代码时出现此错误:

  

缺少TWITTER_KEY的配置。没有服务入口   对于推特

1 个答案:

答案 0 :(得分:-1)

我认为这会有用 https://packagist.org/packages/socialiteproviders/manager

$clientId = "secret";
$clientSecret = "secret";
$redirectUrl = "yourdomain.com/api/redirect";
$additionalProviderConfig = ['site' => 'meta.stackoverflow.com'];
$config = new \SocialiteProviders\Manager\Config($clientId, $clientSecret, $redirectUrl, $additionalProviderConfig);
return Socialite::with('provider-name')->setConfig($config)->redirect();