PHP code example of awema-pl / module-auth

1. Go to this page and download the library: Download awema-pl/module-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/ */

    

awema-pl / module-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 AwemaPL\Auth\Models\Traits\HasSocialAuthentication;
use AwemaPL\Auth\Models\Traits\HasTwoFactorAuthentication;

class User extends Authenticatable
{
    use HasSocialAuthentication, HasTwoFactorAuthentication;
}

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

class User extends Authenticatable
{
    use SendsEmailVerification, SendsPasswordReset;
}

AwemaAuth::routes();

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