PHP code example of bnabriss / mix-auth

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

    

bnabriss / mix-auth example snippets


Bnabriss\MixAuth\MixAuthProvider::class,

// for custom user 
\App\User::first()->generateToken('guard-name');
// for authenticated user 
\App\User::generateTokenForAuth('guard-name');

Route::get('/secure-page', function () {
    return auth('guard-name')->check();
})->middleware('mix.auth:guard-name');

$user->token()->delete();

$user->tokens()->delete();

php artisan vendor:publish --provider="Bnabriss\MixAuth\MixAuthProvider"

php artisan migrate