{"id":40078512,"url":"https://github.com/humweb/sociable","last_synced_at":"2026-01-20T17:59:55.041Z","repository":{"id":56987095,"uuid":"65012118","full_name":"humweb/sociable","owner":"humweb","description":"Persistence layer for Socialite authentication.","archived":false,"fork":false,"pushed_at":"2025-08-06T19:29:01.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-10T07:44:59.259Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2016-08-05T10:58:35.000Z","updated_at":"2025-08-06T19:29:04.000Z","dependencies_parsed_at":"2025-08-06T21:21:29.539Z","dependency_job_id":null,"html_url":"https://github.com/humweb/sociable","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/humweb/sociable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humweb%2Fsociable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humweb%2Fsociable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humweb%2Fsociable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humweb%2Fsociable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humweb","download_url":"https://codeload.github.com/humweb/sociable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humweb%2Fsociable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-01-19T09:03:56.770Z","updated_at":"2026-01-19T09:03:57.488Z","avatar_url":"https://github.com/humweb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sociable\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Software License][ico-license]](LICENSE.md)\n[![Build Status][ico-travis]][link-travis]\n[![Coverage Status][ico-scrutinizer]][link-scrutinizer]\n[![Quality Score][ico-code-quality]][link-code-quality]\n[![Total Downloads][ico-downloads]][link-downloads]\n\nSocialite authentication and persistence layer implementation.\n\n## Install\n\nVia Composer\n\n``` bash\n$ composer require humweb/sociable\n```\n\n**Add ServiceProvider**\n\nIn the `providers` array add the service providers for this package.\n ```php\n Humweb\\Sociable\\ServiceProvider::class\n ```\n\n**Publish configuration in Laravel 5**\n```bash  \n$ php artisan vendor:publish --provider=\"Humweb\\Sociable\\ServiceProvider\"\n```\n\n**Run database migration**\n```bash  \n$ php artisan migrate\"\n```\n\n**Configure user auth driver and provider configs**\n\n```php\n\u003c?php\n\n// config/sociable.php\n\nreturn [\n\n    // Builtin options: laravel, sentinel\n    'auth_provider' =\u003e 'laravel',\n\n    // Optional provider list, mainly used to list login buttons.\n    'providers' =\u003e [\n        'google',\n        'github',\n        'twitter'\n    ]\n];\n```\n\n**Add `Sociable` trait to user model**\n```php\nclass User extends Authenticatable\n{\n    use Sociable;\n}\n```\n\n---\n\n## Getting started\n\nSee `Humweb\\Sociable\\Http\\Controllers\\AuthController.php` for:\n* OAuth login\n* Link third-party service to a user account\n\n##### Example AuthController (Auto-link third-party account after normal login)\n```php\n\u003c?php\n\nclass AuthController extends Controller\n{\n    /**\n     * Login\n     */\n    public function getLogin(Request $request)\n    {\n\n        // Remove social data from session upon request\n        if ($request-\u003eexists('forget_social')) {\n            $request-\u003esession()-\u003eforget('social_link');\n        }\n\n        return view('login');\n    }\n\n\n    public function postLogin(Request $request)\n    {\n\n        // Gather credentials\n        $credentials = [\n            'username' =\u003e $request-\u003eget('username'),\n            'password' =\u003e $request-\u003eget('password'),\n        ];\n\n        if ($user = \\Auth::attempt($credentials, $remember)) {\n\n            // Check for social data in session\n            if ($request-\u003esession()-\u003ehas('social_link')) {\n\n                // Grab data from session\n                $social = $request-\u003esession()-\u003eget('social_link');\n                $user-\u003eattachProvider($social['provider'], $social);\n\n                // Remove link data\n                $request-\u003esession()-\u003eforget('social_link');\n\n                return redirect()\n                    -\u003eintended('/')\n                    -\u003ewith('success', 'Account connected to \"'.$social['provider'].'\" successfully.');\n            }\n\n            return redirect()-\u003eintended('/');\n        }\n\n        // Default error message\n        return back()\n            -\u003ewithInput()\n            -\u003ewithErrors('Invalid login or password.');\n    }\n\n}\n```\n\n\n##### Example message for your login page to remove session info\n\n This can help if the user did not want to auto link the accounts after login.\n```\n@if (session()-\u003ehas('social_link'))\n    \u003cdiv class=\"alert alert-info\"\u003e\n        Login to link your \"{{ session('social_link.provider') }}\" and \"\u003cYour Site\u003e\" accounts. \u003cbr\u003e\n        If this is not what you want \u003ca href=\"/login?forget_social\"\u003eclick here\u003c/a\u003e to refresh.\n    \u003c/div\u003e\n@endif\n```\n\n---\n\n## Change log\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Testing\n\n``` bash\n$ phpunit\n```\n\n## Security\n\nIf you discover any security related issues, please email :author_email instead of using the issue tracker.\n\n## Credits\n\n- [Ryan Shofner](http://github.com/ryun)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/humweb/sociable.svg?style=flat-square\n[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/humweb/sociable/master.svg?style=flat-square\n[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/humweb/sociable.svg?style=flat-square\n[ico-code-quality]: https://img.shields.io/scrutinizer/g/humweb/sociable.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/humweb/sociable.svg?style=flat-square\n\n[link-packagist]: https://packagist.org/packages/humweb/sociable\n[link-travis]: https://travis-ci.org/humweb/sociable\n[link-scrutinizer]: https://scrutinizer-ci.com/g/humweb/sociable/code-structure\n[link-code-quality]: https://scrutinizer-ci.com/g/humweb/sociable\n[link-downloads]: https://packagist.org/packages/humweb/sociable\n[link-author]: https://github.com/:author_username\n[link-contributors]: ../../contributors","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumweb%2Fsociable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumweb%2Fsociable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumweb%2Fsociable/lists"}