PHP code example of geof-dev / filament-web3-auth

1. Go to this page and download the library: Download geof-dev/filament-web3-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/ */

    

geof-dev / filament-web3-auth example snippets


use GeofDev\FilamentWeb3Auth\FilamentWeb3AuthPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(
            FilamentWeb3AuthPlugin::make()
                ->autoRegister(true)      // Auto-create users on first login
                ->showOnLogin(true)       // Show button on login page
        );
}

// config/filament-web3-auth.php

return [
    'enabled' => env('FILAMENT_WEB3_AUTH_ENABLED', true),
    'auto_register' => env('FILAMENT_WEB3_AUTH_AUTO_REGISTER', true),
    'signature_message' => 'Sign this message to authenticate with :app_name. Nonce: :nonce',
    'user_model' => null, // Uses default auth model
    'route_prefix' => 'web3-auth',
    'middleware' => ['web'],
    'auth_middleware' => ['web', 'auth'],
];

protected $fillable = [
    'name',
    'email',
    'password',
    'eth_address',
];

use GeofDev\FilamentWeb3Auth\Pages\Auth\EditProfile;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->profile(EditProfile::class);
}

use Filament\Schemas\Components\View;

View::make('filament-web3-auth::components.wallet-manager')
bash
php artisan vendor:publish --tag="filament-web3-auth-migrations"
php artisan migrate
bash
php artisan vendor:publish --tag="filament-web3-auth-config"
bash
php artisan vendor:publish --tag="filament-web3-auth-views"
css
@source '../../../../vendor/geof-dev/filament-web3-auth/resources/views/**/*.blade.php';