{"id":20388589,"url":"https://github.com/efureev/social","last_synced_at":"2026-05-19T04:06:13.659Z","repository":{"id":56975550,"uuid":"155385379","full_name":"efureev/social","owner":"efureev","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-14T08:32:46.000Z","size":46,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-09T17:42:46.256Z","etag":null,"topics":["laravel","socialite"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efureev.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-30T12:55:52.000Z","updated_at":"2022-03-16T19:20:34.000Z","dependencies_parsed_at":"2022-08-21T11:50:41.350Z","dependency_job_id":null,"html_url":"https://github.com/efureev/social","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/efureev/social","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fsocial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fsocial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fsocial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fsocial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efureev","download_url":"https://codeload.github.com/efureev/social/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efureev%2Fsocial/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267619446,"owners_count":24116560,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["laravel","socialite"],"created_at":"2024-11-15T03:11:44.774Z","updated_at":"2026-05-19T04:06:08.608Z","avatar_url":"https://github.com/efureev.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Stable Version](https://poser.pugx.org/efureev/social/v/stable)](https://packagist.org/packages/efureev/social)\n[![Total Downloads](https://poser.pugx.org/efureev/social/downloads)](https://packagist.org/packages/efureev/social)\n[![Latest Unstable Version](https://poser.pugx.org/efureev/social/v/unstable)](https://packagist.org/packages/efureev/social)\n\n## Information\nWrapper on Laravel Socialite\n\n## Install\n- `composer require efureev/social`\n- Run migrations: `./artisan migrate`.\n- If need - make published config: `./artisan vendor:publish --tag=social`.\n\n## Basic usage\n- Published resources: `php artisan vendor:publish --tag=social`\n- Fill config file `social.php` into `config` dir with your social drivers:\n```php\n\u003c?php\nreturn [\n    'drivers' =\u003e [\n        'vk' =\u003e [\n            'clientId' =\u003e env('VK_CLIENT_ID'),\n            'clientSecret' =\u003e env('VK_CLIENT_SECRET'),\n        ],\n        'github' =\u003e [\n            // ...\n        ],\n        // ...\n    ],\n];\n```\n- add into your app `.env` file variables: `VK_CLIENT_ID=...` and `VK_CLIENT_SECRET=...` with VK credentials. See in `https://vk.com/apps?act=manage`\n- run migration: `php artisan migration`\n- add into view (ex:`resources/views/auth/login.blade.php`):\n  - for list: `@include('social::list', ['socials' =\u003e app('social')-\u003egetProviders()])`\n  - for icons: `@include('social::icons', ['socials' =\u003e app('social')-\u003egetProviders()])`\n- Done! \n\nFor customizing perform - see config and docs.\n\n## Config\n\n### Config Props \n- `redirectOnAuth` [string] redirect on address after user auth.\n- `onSuccess` [\\Closure|array] action on auth success. Params: \\Fureev\\Socialite\\Two\\AbstractProvider\n- `drivers` [array] Driver list (`driverName =\u003e driverConfig`)\n- `userClass` [string] Auth User Class (`userClass =\u003e 'App/Models/User'`)\n\n### Driver Config\n- `clientId` [string] Require\n- `clientSecret` [string] Require\n- `enabled`  [bool] Default, true.\n- `label` [string] Title for view. Default, `driverName`\n- `provider` [string] Class of Provider (\\Fureev\\Socialite\\Two\\AbstractProvider)\n- `url_token`  [string] Token URL for the provider\n- `url_auth`   [string] Authentication URL for the provider\n- `userInfoUrl`   [string] Url to get the raw user data\n- `onSuccess` [\\Closure|array] action on auth success. Overwrite common `onSuccess` \n- `scopeSeparator` [string]\n- `scopes` [array]\n\n### Example\nFile `config/social.php`\n```php\n\u003c?php\n\nreturn [\n    'onSuccess' =\u003e function ($driver) {\n        $user = \\Fureev\\Social\\Services\\SocialAccountService::setOrGetUser($driver);\n\n        return \\Fureev\\Social\\Services\\SocialAccountService::auth($user);\n    },\n    //'onSuccess' =\u003e [\\App\\Http\\Controllers\\IndexController::class, 'index'],\n    'drivers'   =\u003e [\n        'gitlab' =\u003e [\n            'enabled'  =\u003e false,\n            'provider' =\u003e \\Fureev\\Socialite\\Two\\GitlabProvider::class,\n            //            'enabled'  =\u003e false,\n            'label'    =\u003e '\u003ci class=\"fab fa-gitlab\"\u003e\u003c/i\u003e'\n        ],\n        'vk'     =\u003e [\n            // 'enabled'  =\u003e false,\n            'label'        =\u003e '\u003ci class=\"fab fa-vk\"\u003e\u003c/i\u003e',\n            'clientId'     =\u003e env('VK_CLIENT_ID'),\n            'clientSecret' =\u003e env('VK_CLIENT_SECRET'),\n        ],\n        'github' =\u003e [\n            'enabled' =\u003e false,\n            'label'   =\u003e '\u003ci class=\"fab fa-github-alt\"\u003e\u003c/i\u003e'\n        ],\n        'custom_auth' =\u003e [\n            'clientId' =\u003e env('SOCIAL_AUTH_CLIENT_ID'),\n            'clientSecret' =\u003e env('SOCIAL_AUTH_CLIENT_SECRET'),\n            'url_auth' =\u003e 'http://api.auth.x/auth/authorize',\n            'url_token' =\u003e 'http://api.auth.x/auth/token',\n            'userInfoUrl' =\u003e 'http://api.auth.x/users/info',\n            'scopeSeparator' =\u003e ',',\n            'scopes' =\u003e ['name','email','photo'],\n            'tokenFieldsExtra' =\u003e [\n                'grant_type' =\u003e 'authorization_code',\n            ],\n            'mapFields' =\u003e\n                [\n                    'id' =\u003e 'id',\n                    'name' =\u003e ['profile.first_name.v', new \\Fureev\\Socialite\\Separator, 'profile.last_name.v'],\n                    'email' =\u003e 'profile.email.v',\n                    'avatar' =\u003e 'photo',\n                    'nickname' =\u003e 'id',\n                    'profileId' =\u003e 'profileId',\n                ],\n            'guzzle' =\u003e [\n                'query' =\u003e [\n                    'prettyPrint' =\u003e 'false',\n                ],\n                'headers' =\u003e [\n                    'Accept' =\u003e 'application/json',\n                    'Authorization' =\u003e 'Bearer {{%TOKEN%}}',\n                ],\n            ],\n        ],\n        'google' =\u003e [\n            // 'enabled'      =\u003e false,\n            'clientId'         =\u003e env('G+_CLIENT_ID'),\n            'clientSecret'     =\u003e env('G+_CLIENT_SECRET'),\n            'url_token'        =\u003e 'https://accounts.google.com/o/oauth2/token',\n            'url_auth'         =\u003e 'https://accounts.google.com/o/oauth2/auth',\n            'userInfoUrl'      =\u003e 'https://www.googleapis.com/plus/v1/people/me?',\n            'label'            =\u003e '\u003ci class=\"fab fa-google\"\u003e\u003c/i\u003e',\n            //            'onSuccess'        =\u003e [\\App\\Http\\Controllers\\HomeController::class, 'index'],\n            'scopeSeparator'   =\u003e ' ',\n            'scopes'           =\u003e ['openid', 'profile', 'email',],\n            'tokenFieldsExtra' =\u003e [\n                'grant_type' =\u003e 'authorization_code'\n            ],\n            'mapFields'        =\u003e\n                [\n                    'id'     =\u003e 'id',\n                    'name'   =\u003e 'displayName',\n                    'email'  =\u003e 'emails.0.value',\n                    'avatar' =\u003e 'image.url',\n                ],\n            'guzzle'           =\u003e [\n                'query'   =\u003e [\n                    'prettyPrint' =\u003e 'false',\n                ],\n                'headers' =\u003e [\n                    'Accept'        =\u003e 'application/json',\n                    'Authorization' =\u003e 'Bearer {{%TOKEN%}}',\n                ],\n            ]\n        ]\n    ]\n];\n\n```\n\nFile `\\App\\Services\\SocialAccountService.php`\n```php\n\u003c?php \nuse Fureev\\Socialite\\Contracts\\Provider as ProviderContract;\nclass SocialAccountService\n{\n    public static function setOrGetUser(ProviderContract $provider)\n    {\n        $providerUser = $provider-\u003euser();\n\n        $providerName = $provider-\u003egetName();\n\n        //...\n\n    }\n}\n```\nAuto add social providers in your view: \n```blade\n@extends('layouts.login')\n\n@section('content')\n  \u003cform method=\"POST\" action=\"{{ route('login') }}\"\u003e\n    @csrf\n    \u003cdiv class=\"input-group\"\u003e\n      \u003cinput type=\"text\" name=\"email\" id=\"email\"\n             class=\"input-text\" autocomplete=\"email\"\n             spellcheck=\"false\" required autofocus value=\"{{ old('email') }}\"\u003e\u003ci class=\"ig-helpers\"\u003e\u003c/i\u003e\n      \u003clabel for=\"email\" class=\"input-label\"\u003eE-mail\u003c/label\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"input-group\"\u003e\n      \u003cinput type=\"password\" name=\"password\" id=\"password\" autocomplete=\"password\"\n             class=\"input-text\" required\u003e\u003ci class=\"ig-helpers\"\u003e\u003c/i\u003e\n      \u003clabel class=\"input-label\" for=\"password\"\u003eПароль\u003c/label\u003e\n    \u003c/div\u003e\n    \u003cdiv class=\"buttons\"\u003e\n      \u003cbutton class=\"btn-rnd\" type=\"submit\"\u003e\u003ci class=\"fas fa-sign-in-alt\"\u003e\u003c/i\u003e\u003c/button\u003e\n      \u003ca href=\"{{ route('password.request') }}\" title=\"забыли пароль?\"\u003e\u003ci class=\"far fa-question-circle\"\u003e\u003c/i\u003e\u003c/a\u003e\n    \u003c/div\u003e\n    @include('social::icons', ['socials' =\u003e app('social')-\u003egetProviders()])\n    // or \n    @include('social::list', ['socials' =\u003e app('social')-\u003egetProviders()])\n  \u003c/form\u003e\n@endsection\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fsocial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefureev%2Fsocial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefureev%2Fsocial/lists"}