PHP code example of dusterio / laravel-google-guard

1. Go to this page and download the library: Download dusterio/laravel-google-guard 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/ */

    

dusterio / laravel-google-guard example snippets


Dusterio\LaravelGoogleGuard\Integrations\LaravelServiceProvider::class,

    'guards' => [
        /// Your existing guards
        /// ...    
        'google' => [
            /*
             * For consistency, return a dummy (not persisted) class holder.
            */
            'userClass' => '\App\User',

            /*
             * Remember users for this number of seconds.
             */
            'timeout' => 3600,

            /*
             * Users that can use the app. If left empty, everybody is allowed.
             */
            'whitelist' => [
                'admin@.',
            ]
        ]              
    ]

        'web' => [
            'driver' => 'google',
            'provider' => 'users',
        ],

    'google' => [
        'client_id' => env('GOOGLE_CLIENT_ID'),
        'client_secret' => env('GOOGLE_CLIENT_SECRET'),
        'redirect' => env('APP_URL') . '/auth/google/callback',
    ],
config/auth.php
config/auth.php
config/services.php