PHP code example of codebarista / nova-webauthn

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

    

codebarista / nova-webauthn example snippets


namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Laragear\Webauthn\Contracts\WebAuthnAuthenticatable;
use Laragear\Webauthn\WebAuthnAuthentication;

class User extends Authenticatable implements WebAuthnAuthenticatable
{
    use WebAuthnAuthentication;

    // ...
}

namespace App\Nova;

use Codebarista\NovaWebauthn\NovaWebauthn;
use Laravel\Nova\Http\Requests\NovaRequest;

class User extends Resource
{
    public function fields(NovaRequest $request): array
    {
        return [
            // ...
            NovaWebauthn::make(),
        ];
    }
}
shell
php artisan codebarista:webauthn-setup