PHP code example of mckenziearts / laravel-oauth

1. Go to this page and download the library: Download mckenziearts/laravel-oauth library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mckenziearts / laravel-oauth example snippets


  Mckenziearts\LaravelOAuth\LaravelOAuthServiceProvider::class,
  

  'users' => [
      'table'   => 'users',
  ],
  

    'providers' => [
      'facebook'  => true,
      'google'    => true,
      'github'    => true,
    ],
  

  namespace App\Http\Controllers\Auth;
  
  use App\Http\Controllers\Controller;
  use Illuminate\Foundation\Auth\AuthenticatesUsers;
  use Mckenziearts\LaravelOAuth\Traits\OAuthSocialite;
  
  class LoginController extends Controller
  {
      use OAuthSocialite;
      ..
  

  Route::get('/auth/{provider}', 'Auth\LoginController@redirectToProvider');
  Route::get('/callback/{provider}', 'Auth\LoginController@handleProviderCallback');
  
shell
  php artisan vendor:publish --provider="Mckenziearts\LaravelOAuth\LaravelOAuthServiceProvider"
  
shell
  composer dump-autoload
  

php artisan vendor:publish --tag=laravel-oauth.assets --force
php artisan vendor:publish --tag=laravel-oauth.config --force
php artisan vendor:publish --tag=laravel-oauth.migrations --force

  php artisan migrate