{"id":17922706,"url":"https://github.com/overtrue/laravel-socialite","last_synced_at":"2025-05-16T01:07:53.838Z","repository":{"id":2875707,"uuid":"47725432","full_name":"overtrue/laravel-socialite","owner":"overtrue","description":":octocat: Social OAuth Authentication for Laravel 5. drivers: facebook, github, google, linkedin, weibo, qq, wechat and douban","archived":false,"fork":false,"pushed_at":"2024-03-13T05:06:10.000Z","size":30,"stargazers_count":340,"open_issues_count":0,"forks_count":47,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-11T22:16:34.396Z","etag":null,"topics":["facebook","google","laravel-socialite","linkedin","social-login","socialite","wechat","weibo"],"latest_commit_sha":null,"homepage":"","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/overtrue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["overtrue"]}},"created_at":"2015-12-09T23:23:31.000Z","updated_at":"2025-02-01T06:24:12.000Z","dependencies_parsed_at":"2024-06-18T13:50:35.836Z","dependency_job_id":null,"html_url":"https://github.com/overtrue/laravel-socialite","commit_stats":{"total_commits":30,"total_committers":5,"mean_commits":6.0,"dds":0.1333333333333333,"last_synced_commit":"2865a156fde913909693edc180d16d3ae26dbd05"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-socialite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-socialite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-socialite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/overtrue%2Flaravel-socialite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/overtrue","download_url":"https://codeload.github.com/overtrue/laravel-socialite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254448578,"owners_count":22072764,"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","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":["facebook","google","laravel-socialite","linkedin","social-login","socialite","wechat","weibo"],"created_at":"2024-10-28T20:40:32.012Z","updated_at":"2025-05-16T01:07:48.750Z","avatar_url":"https://github.com/overtrue.png","language":"PHP","funding_links":["https://github.com/sponsors/overtrue"],"categories":[],"sub_categories":[],"readme":"# Laravel Socialite\n\n![Laravel Octane Ready Status](https://img.shields.io/badge/Octance-ready-green?style=flat-square)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/overtrue/laravel-socialite?style=flat-square)\n![GitHub License](https://img.shields.io/github/license/overtrue/laravel-socialite?style=flat-square)\n![Packagist Downloads](https://img.shields.io/packagist/dt/overtrue/laravel-socialite?style=flat-square)\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me-button-s.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n# Installation\n\n```\n$ composer require \"overtrue/laravel-socialite\"\n```\n\n\u003e if you have been installed the `overtrue/socialite` package, please remove it from `composer.json` before this command.\n\n# Configuration\n\n1. You will also need to add credentials for the OAuth services your application utilizes. These credentials should be placed in your `config/socialite.php` or `config/services.php` configuration file, and should use the key facebook, twitter, linkedin, google, github or bitbucket, depending on the providers your application requires. For example:\n\n```php\n \u003c?php\n\n return [\n     //...\n     'github' =\u003e [\n         'client_id'     =\u003e 'your-app-id',\n         'client_secret' =\u003e 'your-app-secret',\n         'redirect'      =\u003e 'http://localhost/socialite/callback.php',\n     ],\n     //...\n ];\n```\n\n# Usage\n\n```php\n\u003c?php\n\nnamespace App\\Http\\Controllers;\n\nuse Socialite;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Routing\\Controller;\n\nclass AuthController extends Controller\n{\n    /**\n     * Redirect the user to the GitHub authentication page.\n     */\n    public function redirectToProvider()\n    {\n        return redirect()-\u003eto(Socialite::create('github')-\u003eredirect());\n    }\n\n    /**\n     * Obtain the user information from GitHub.\n     */\n    public function handleProviderCallback(Request $request)\n    {\n        $user = Socialite::create('github')-\u003euserFromCode($request-\u003equery('code'));\n\n        // $user-\u003egetId();\n        // $user-\u003egetNickname();\n        // ...\n    }\n}\n```\n\nAnd register routes:\n\n```php\nRoute::get('/oauth/github', 'AuthController@redirectToProvider');\nRoute::get('/oauth/github/callback', 'AuthController@handleProviderCallback');\n```\n\nAbout more usage, please refer to [overtrue/socialite](https://github.com/overtrue/socialite).\n\n## :heart: Sponsor me\n\n[![Sponsor me](https://github.com/overtrue/overtrue/blob/master/sponsor-me.svg?raw=true)](https://github.com/sponsors/overtrue)\n\n如果你喜欢我的项目并想支持它，[点击这里 :heart:](https://github.com/sponsors/overtrue)\n\n## Project supported by JetBrains\n\nMany thanks to Jetbrains for kindly providing a license for me to work on this and other open-source projects.\n\n[![](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg)](https://www.jetbrains.com/?from=https://github.com/overtrue)\n\n## PHP 扩展包开发\n\n\u003e 想知道如何从零开始构建 PHP 扩展包？\n\u003e\n\u003e 请关注我的实战课程，我会在此课程中分享一些扩展开发经验 —— [《PHP 扩展包实战教程 - 从入门到发布》](https://learnku.com/courses/creating-package)\n\n# License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-socialite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fovertrue%2Flaravel-socialite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fovertrue%2Flaravel-socialite/lists"}