PHP code example of randomparanoia / filament-column-obfuscation

1. Go to this page and download the library: Download randomparanoia/filament-column-obfuscation 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/ */

    

randomparanoia / filament-column-obfuscation example snippets


use RandomParanoia\FilamentColumnObfuscation\Columns\ObfuscatedColumn;

// In your Filament resource or table
public static function table(Table $table): Table
{
    return $table
        ->columns([
            // Basic usage - masks most characters
            ObfuscatedColumn::make('email')
                ->label('Email Address'),

            // Advanced usage with customization
            ObfuscatedColumn::make('phone_number')
                ->obfucastionPattern('phone')
                ->label('Phone Number')
                ->showFirstChars(3)
                ->showLastChars(2)
                ->obfuscationCharacter('*')
                ->revealOnClick(),
        ]);
}

use RandomParanoia\FilamentColumnObfuscation\Columns\ObfuscatedColumn;

ObfuscatedColumn::make('email')
    ->label('Email Address');

use RandomParanoia\FilamentColumnObfuscation\Columns\ObfuscatedColumn;

ObfuscatedColumn::make('email')
    ->obfuscationPattern('email')
    ->label('Email Address');

ObfuscatedColumn::make('credit_card')
    ->showFirstChars(4)             // Show first 4 characters
    ->showLastChars(4)              // Show last 4 characters
    ->obfuscationCharacter('-')     // Use custom character
    ->revealOnClick()               // Allow revealing on click
    ->revealOnHover()               // OR allow revealing on hover