PHPackages                             it-devgroup/laravel-user-oauth2-attach - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. it-devgroup/laravel-user-oauth2-attach

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

it-devgroup/laravel-user-oauth2-attach
======================================

Laravel user attach from social networks on a oauth2

1.0.2(4y ago)08MITPHPPHP ^7.4|^8.0

Since May 17Pushed 4y ago2 watchersCompare

[ Source](https://github.com/it-devgroup/laravel-user-oauth2-attach)[ Packagist](https://packagist.org/packages/it-devgroup/laravel-user-oauth2-attach)[ RSS](/packages/it-devgroup-laravel-user-oauth2-attach/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

Description
-----------

[](#description)

Joining a profile from a social network to the site using Auth2. Can be used to implement authorization via social networks. Available services: google and facebook.

Install for Lumen
-----------------

[](#install-for-lumen)

**1.** Open file `bootstrap/app.php`

Uncommented strings

```
$app->withFacades();
$app->withEloquent();

```

Added after **$app-&gt;configure('app');**

```
$app->configure('user_oauth2_attach');

```

add new service provider

```
$app->register(\ItDevgroup\LaravelUserOAuth2Attach\Providers\UserOAuth2AttachServiceProvider::class);

```

**2.** Run commands

For creating config file

```
php artisan user:oauth2:attach:publish --tag=config

```

For creating migration file

```
php artisan user:oauth2:attach:publish --tag=migration

```

For generate table

```
php artisan migrate

```

Install for laravel
-------------------

[](#install-for-laravel)

**1.** Open file **config/app.php** and search

```
    'providers' => [
        ...
    ]

```

Add to section

```
        \ItDevgroup\LaravelUserOAuth2Attach\Providers\UserOAuth2AttachServiceProvider::class,

```

Example

```
    'providers' => [
        ...
        \ItDevgroup\LaravelUserOAuth2Attach\Providers\UserOAuth2AttachServiceProvider::class,
    ]

```

**2.** Run commands

For creating config file

```
php artisan vendor:publish --provider="ItDevgroup\LaravelUserOAuth2Attach\Providers\UserOAuth2AttachServiceProvider" --tag=config

```

For creating migration file

```
php artisan user:oauth2:attach:publish --tag=migration

```

For generate table

```
php artisan migrate

```

Custom model
------------

[](#custom-model)

###### Step 1

[](#step-1)

Create custom model for user OAuth2

Example:

File: **app/CustomFile.php**

Content:

```
