PHP code example of awes-io / auth

1. Go to this page and download the library: Download awes-io/auth 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/ */

    

awes-io / auth example snippets


'enabled' => [
    'social', 
    // 'two_factor',
    // 'email_verification',
],

'services' => [
    'github' => [
        'name' => 'GitHub'
    ],
    ...
],
'github' => [
    'client_id' => env('GITHUB_CLIENT_ID'),
    ...
],

'redirects' => [
    'login' => '/twofactor',
    'reset_password' => '/',
    ...
],

# SOCIALITE GITHUB
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URL=http://auth.test/login/github/callback

# TWO FACTOR AUTHY
AUTHY_SECRET=

use AwesIO\Auth\Models\Traits\HasSocialAuthentication;
use AwesIO\Auth\Models\Traits\HasTwoFactorAuthentication;

class User extends Authenticatable
{
    use HasSocialAuthentication, HasTwoFactorAuthentication;
}

use AwesIO\Auth\Models\Traits\SendsPasswordReset;
use AwesIO\Auth\Models\Traits\SendsEmailVerification;

class User extends Authenticatable
{
    use SendsEmailVerification, SendsPasswordReset;
}

AwesAuth::routes();

AwesAuth::routes(['register' => false]);
bash
php artisan vendor:publish --provider="AwesIO\Auth\AuthServiceProvider" --tag="migrations"
bash
php artisan migrate
bash
php artisan vendor:publish --provider="AwesIO\Auth\AuthServiceProvider" --tag="views"
bash
php artisan vendor:publish --provider="AwesIO\Auth\AuthServiceProvider" --tag="config"