Reputation: 405
I am getting the following error when I trying to use Socialite with Laravel and extending it with SocialiteProviders. I have tried other solutions but nothing seems to get rid of this error. Does anyone have any suggestions??? Thanks.
ERROR: Class 'SocialiteProviders\Manager\ServiceProvider' not found
File: Composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"arcanedev/log-viewer": "~4.7.0",
"barryvdh/laravel-cors": "^0.11.3",
"beyondcode/laravel-mailbox": "^1.2",
"browner12/helpers": "^2.1",
"chumper/zipper": "^1.0",
"fideloper/proxy": "^4.0",
"intervention/image": "^2.5",
"laravel/framework": "5.8.*",
"laravel/socialite": "^4.3",
"laravel/tinker": "^1.0",
"league/flysystem-sftp": "^1.0",
"phpmailer/phpmailer": "^6.0",
"socialiteproviders/facebook": "^1.0",
"socialiteproviders/generators": "^4.5",
"socialiteproviders/github": "dev-master",
"socialiteproviders/google": "^3.0",
"socialiteproviders/instagram": "^3.0",
"socialiteproviders/linkedin": "^3.1",
"socialiteproviders/manager": "^3.4",
"socialiteproviders/twitter": "^3.0",
"socialiteproviders/vkontakte": "^4.0",
"socialiteproviders/youtube": "^3.0",
"stripe/stripe-php": "^6.40",
"toin0u/geocoder-laravel": "^4.1",
"tymon/jwt-auth": "1.0.*",
"zanysoft/laravel-zip": "^1.0"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^7.5",
"infyomlabs/laravel-generator": "5.8.x-dev",
"laravelcollective/html": "^5.8.0",
"infyomlabs/adminlte-templates": "5.8.x-dev",
"infyomlabs/swagger-generator": "dev-master",
"appointer/swaggervel": "dev-master",
"doctrine/dbal": "~2.3"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
File app.php
'providers' => [
\SocialiteProviders\Manager\ServiceProvider::class,
],
'aliases' => [
'Socialite' => Illuminate\Socialite\Facades\Socialite::class,
],
File: EventServiceProvider.php
protected $listen = [
\SocialiteProviders\Manager\SocialiteWasCalled::class => [
// add your listeners (aka providers) here
'SocialiteProviders\\Facebook\\FacebookExtendSocialite@handle',
'SocialiteProviders\\GitHub\\GitHubExtendSocialite@handle',
'SocialiteProviders\\Google\\GoogleExtendSocialite@handle',
'SocialiteProviders\\Instagram\\InstagramExtendSocialite@handle',
'SocialiteProviders\\LinkedIn\\LinkedInExtendSocialite@handle',
'SocialiteProviders\\PayPal\\PayPalExtendSocialite@handle',
'SocialiteProviders\\Twitter\\TwitterExtendSocialite@handle',
'SocialiteProviders\\VKontakte\\VKontakteExtendSocialite@handle',
'SocialiteProviders\\YouTube\\YouTubeExtendSocialite@handle',
],
Registered::class => [
SendEmailVerificationNotification::class,
],
];
File: AuthController.php
namespace App\Http\Controllers\Web;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Socialite;
class AuthController extends Controller
{
...
Upvotes: 2
Views: 1954
Reputation: 405
Newbie issue.... Composer self "Killed". Fixed the issue by adding swap memory before running composer.
UPDATED to include the command I used to add swap and fix the problem.
/bin/dd if=/dev/zero of=/var/swap.1 bs=1M count=1024
/sbin/mkswap /var/swap.1
sudo /sbin/swapon /var/swap.1
Upvotes: 1