{"id":13405411,"url":"https://github.com/mckenziearts/laravel-oauth","last_synced_at":"2025-04-30T07:25:08.789Z","repository":{"id":62526102,"uuid":"139203549","full_name":"mckenziearts/laravel-oauth","owner":"mckenziearts","description":":octocat: Social OAuth authentication for Laravel 5 \u0026 6. Drivers: Facebook, Twitter, Google, LinkedIn, Github, Bitbucket.","archived":false,"fork":false,"pushed_at":"2019-09-29T07:26:28.000Z","size":183,"stargazers_count":52,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-30T13:51:16.717Z","etag":null,"topics":["laravel","laravel-socialite","oauth","oauth2-authentication","php","social-login","social-oauth-authentication","socialite"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mckenziearts.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"contributing.md","funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-29T23:07:48.000Z","updated_at":"2024-09-08T10:54:31.000Z","dependencies_parsed_at":"2022-11-02T15:31:34.070Z","dependency_job_id":null,"html_url":"https://github.com/mckenziearts/laravel-oauth","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckenziearts%2Flaravel-oauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckenziearts%2Flaravel-oauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckenziearts%2Flaravel-oauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mckenziearts%2Flaravel-oauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mckenziearts","download_url":"https://codeload.github.com/mckenziearts/laravel-oauth/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251659516,"owners_count":21623064,"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":["laravel","laravel-socialite","oauth","oauth2-authentication","php","social-login","social-oauth-authentication","socialite"],"created_at":"2024-07-30T19:02:01.380Z","updated_at":"2025-04-30T07:25:08.745Z","avatar_url":"https://github.com/mckenziearts.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\u003cimg src=\"https://pix.watch/eId5wn/1PuLWY.png\"\u003e\u003c/p\u003e\n\n[![Latest Version on Packagist][ico-version]][link-packagist]\n[![Total Downloads][ico-downloads]][link-downloads]\n[![Build Status](https://scrutinizer-ci.com/g/Mckenziearts/laravel-oauth/badges/build.png?b=master)](https://scrutinizer-ci.com/g/Mckenziearts/laravel-oauth/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/Mckenziearts/laravel-oauth/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/mckenziearts/laravel-oauth/?branch=master)\n[![StyleCI][ico-styleci]][link-styleci]\n\n## Introduction\n\nSocial OAuth authentication for Laravel 5 which provides oAuth support in PHP 5.3+ and is very easy to integrate with any project which requires an oAuth client. This package use [Laravel Socialite](https://github.com/laravel/socialite). For Laravel 4 look this [package](https://github.com/artdarek/oauth-4-laravel) \n\n## Supported services\n\nThe library supports OAuth 2.0 compliant services. A list of currently implemented services can be found below. More services will be implemented soon.\n\nIncluded service implementations:\n\n- OAuth2\n    - Facebook\n    - GitHub\n    - Google\n    - Instagram\n    - LinkedIn\n    - Bitbucket\n    - Twitter\n    - Dribbble\n    - Pinterest\n    - Youtube\n    - Gitlab\n- more to come!\n\nLaravel Support version\n\n| **Laravel**  |  **laravel-oauth** |\n|---|---|\n| \u003c=5.5  | ^1.0  |\n| 6.0  | ^1.1  |\n\n## Installation\n\n1. Include the package in your project using Composer\n\n  ``` shell\n  $ composer require mckenziearts/laravel-oauth\n  ```\n\n2. Add the service provider to your `config/app.php` providers array:\n\n   **For Laravel 5.5.+ - you're done.**\n\n  ```php\n  Mckenziearts\\LaravelOAuth\\LaravelOAuthServiceProvider::class,\n  ```\n    \n3. Publish the Vendor Assets files by running:\n\n  ```shell\n  php artisan vendor:publish --provider=\"Mckenziearts\\LaravelOAuth\\LaravelOAuthServiceProvider\"\n  ```\n\n4. Now that we have published a few new files to our application we need to reload them with the following command:\n\n  ```shell\n  composer dump-autoload\n  ```\n  \n## Configuration\n\nWhen you published the vendor assets you added a new file inside of your `config` folder which is called `config/laravel-oauth.php`. This file contains a bunch of configuration you can use to configure your connexion using social networks.\n\nFirst, you have to add your service like is defined on The official documentation of Socialite [available here](https://laravel.com/docs/5.6/socialite#configuration). Just setup your \nOauth services for your application. Laravel/socialite is automatically installed by this package.\n  \n## Usage\n\n1. Fisrt of all in the `config/laravel-oauth.php` file you must define the default users table name to simplify migrations. By default users table is used\n  \n  ```php\n  'users' =\u003e [\n      'table'   =\u003e 'users',\n  ],\n  ```\n  \n2. Secondly you must specify the providers to use for social login in the `providers` array. To active a provider set the value to `true`\n\n  ```php\n    'providers' =\u003e [\n      'facebook'  =\u003e true,\n      'google'    =\u003e true,\n      'github'    =\u003e true,\n    ],\n  ```\n  \nThe last configuration is to stylize the button by editing class name and add or remove icon\n\n![](https://pix.watch/m3qMiw/Q8fKIi.png)\n\nNext, if you may want to re-publish the laravel-oauth assets, config, and the migrations run the following command:\n\n```\nphp artisan vendor:publish --tag=laravel-oauth.assets --force\nphp artisan vendor:publish --tag=laravel-oauth.config --force\nphp artisan vendor:publish --tag=laravel-oauth.migrations --force\n```\n\n3. Next to make sure you have the latest database schema run:\n\n  ```\n  php artisan migrate\n  ```\n\n4. Inside of your master.blade.php file include a header yield. Inside the head of your master or app.blade.php add the following:\n\n  ```\n  @yield('css')\n  ```\n\n5. Add the blade directive to your view where you want to display the socials buttons. The directive takes a parameter `login` to display the login text or `resgister` for the text related to the registration\n\n  ```\n  @socialite('login')\n  ```\n\n6. Add the style of the buttons by adding this to your view in the section in the `@yield('css')` who defined in your master layout\n\n```\n@section('css')\n    \u003clink href=\"{{ url('/vendor/mckenziearts/laravel-oauth/assets/css/socialite.css') }}\" rel=\"stylesheet\"\u003e\n@endsection\n```\n\n7. In the `Auth\\LoginController` of your application, add the `OAuthSocialite` trait:\n\n  ```php\n  namespace App\\Http\\Controllers\\Auth;\n  \n  use App\\Http\\Controllers\\Controller;\n  use Illuminate\\Foundation\\Auth\\AuthenticatesUsers;\n  use Mckenziearts\\LaravelOAuth\\Traits\\OAuthSocialite;\n  \n  class LoginController extends Controller\n  {\n      use OAuthSocialite;\n      ..\n  ```\nWith this feature you can overwrite the present methods on the trait if you want to customize them even more\n\n8. Add this routes to your default web route file\n  ```php\n  Route::get('/auth/{provider}', 'Auth\\LoginController@redirectToProvider');\n  Route::get('/callback/{provider}', 'Auth\\LoginController@handleProviderCallback');\n  ```\n\n## Change log\n\nPlease see the [changelog.md](changelog.md) for more information on what has changed recently.\n\n## Testing\n\n``` bash\n$ composer test\n```\n\n## Contributing\n\nPlease see [contributing.md](contributing.md) for details and a todolist.\n\n## Security\n\nIf you discover any security related issues, please email monneylobe@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Arthur Monney](https://www.twitter.com/monneyarthur)\n- [Laravel Socialite](https://laravel.com/docs/5.6/socialite)\n\n## License\n\nMIT. Please see the [license.md](license.md) for more information.\n\n[ico-version]: https://img.shields.io/packagist/v/mckenziearts/laravel-oauth.svg?style=flat-square\n[ico-downloads]: https://img.shields.io/packagist/dt/mckenziearts/laravel-oauth.svg?style=flat-square\n[ico-travis]: https://img.shields.io/travis/mckenziearts/laravel-oauth/master.svg?style=flat-square\n[ico-styleci]: https://styleci.io/repos/139203549/shield\n\n[link-packagist]: https://packagist.org/packages/mckenziearts/laravel-oauth\n[link-downloads]: https://packagist.org/packages/mckenziearts/laravel-oauth\n[link-travis]: https://travis-ci.org/Mckenziearts/laravel-oauth\n[link-styleci]: https://styleci.io/repos/139203549\n[link-author]: https://github.com/mckenziearts\n[link-contributors]: ../../contributors]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckenziearts%2Flaravel-oauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmckenziearts%2Flaravel-oauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmckenziearts%2Flaravel-oauth/lists"}