You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:octocat: Social OAuth authentication for Laravel 5. Drivers: Facebook, Twitter, Google, LinkedIn, Github. This package use [https://github.com/laravel/socialite](Laravel Socialite).
10
+
Social OAuth authentication for Laravel 5. Drivers: Facebook, Twitter, Google, LinkedIn, Github. This package use [https://github.com/laravel/socialite](Laravel Socialite).
11
11
12
12
## Installation
13
13
14
14
1. Include the package in your project using Composer
4. Now that we have published a few new files to our application we need to reload them with the following command:
35
35
36
-
```bash
36
+
```shell
37
37
composer dump-autoload
38
38
```
39
39
40
+
## Configuration
41
+
42
+
When you published the vendor assets you added a new file inside of your `config` folder which is called `config/laravel-socialite.php`. This file contains a bunch of configuration you can use to configure your connexion using social networks.
43
+
44
+
First, you have to add your service like is defined on The official documentation of Socialite [https://laravel.com/docs/5.6/socialite#configuration](available here). Just setup your
45
+
Oauth services for your application. Laravel/socialite is automatically installed by this package.
40
46
41
47
## Usage
42
48
49
+
1. Fisrt of all in the `config/laravel-socialite.php` file you must define the default users table name to simplify migrations. By default users table is used
50
+
51
+
```php
52
+
'users' => [
53
+
'table' => 'users',
54
+
],
55
+
```
56
+
57
+
2. Secondly you must specify the providers to use for social login in the `providers` array. To active a provider set the value to `true`
58
+
59
+
```php
60
+
'providers' => [
61
+
'facebook' => true,
62
+
'google' => true,
63
+
'github' => true,
64
+
],
65
+
```
66
+
67
+
The last configuration is to stylize the button by editing class name and add or remove icon
68
+
69
+

70
+
71
+
Next, if you may want to re-publish the laravel-socialite assets, config, and the migrations run the following command:
3. Next to make sure you have the latest database schema run:
80
+
81
+
```
82
+
php artisan migrate
83
+
```
84
+
85
+
4. Inside of your master.blade.php file include a header yield. Inside the head of your master or app.blade.php add the following:
86
+
87
+
```
88
+
@yield('css')
89
+
```
90
+
91
+
5. 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
92
+
93
+
```
94
+
@socialite('login')
95
+
```
96
+
97
+
6. 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
0 commit comments