PHP code example of laravelgpt / data-breach

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

    

laravelgpt / data-breach example snippets


return [
    'apis' => [
        'hibp' => env('HIBP_API_KEY'),
        'dehashed' => env('DEHASHED_API_KEY'),
        'virustotal' => env('VIRUSTOTAL_API_KEY'),
        'abuseipdb' => env('ABUSEIPDB_API_KEY'),
        'ipqs' => env('IPQS_API_KEY'),
    ],
    'frontend' => env('DATA_BREACH_FRONTEND', 'livewire'),
    'cursor' => [
        'tracking_enabled' => env('DATA_BREACH_CURSOR_TRACKING', true),
        'session_logging' => env('DATA_BREACH_CURSOR_SESSION_LOGGING', true),
        'analytics_enabled' => env('DATA_BREACH_CURSOR_ANALYTICS', true),
        'ai_ux_feedback' => env('DATA_BREACH_CURSOR_AI_UX_FEEDBACK', true),
        'bug_report_enrichment' => env('DATA_BREACH_CURSOR_BUG_REPORT', true),
        'archive_policy_days' => env('DATA_BREACH_CURSOR_ARCHIVE_DAYS', 30),
    ],
    'alerts' => [
        'email' => env('DATA_BREACH_EMAIL_ALERTS', true),
        'telegram' => env('DATA_BREACH_TELEGRAM_ALERTS', false),
        'telegram_bot_token' => env('TELEGRAM_BOT_TOKEN'),
        'telegram_chat_id' => env('TELEGRAM_CHAT_ID'),
    ],
];

use LaravelGPT\DataBreach\Services\PasswordBreachService;

$breachService = app(PasswordBreachService::class);
$result = $breachService->checkPassword('password123');

use LaravelGPT\DataBreach\Services\IpReputationService;

$ipService = app(IpReputationService::class);
$result = $ipService->checkIp('8.8.8.8');

use LaravelGPT\DataBreach\Services\CursorAnalyticsService;

$analyticsService = app(CursorAnalyticsService::class);

// Track cursor event
$analyticsService->trackCursorEvent($request, [
    'x' => 100,
    'y' => 200,
    'event_type' => 'click',
    'element_id' => 'submit-button',
    'velocity' => 150
]);

// Get session analytics
$analytics = $analyticsService->getSessionAnalytics($sessionKey);

use LaravelGPT\DataBreach\Services\SessionReplayService;

$replayService = app(SessionReplayService::class);

// Start recording
$sessionKey = $replayService->startRecording($request);

// Record events
$replayService->recordEvent($sessionKey, [
    'type' => 'click',
    'data' => ['x' => 100, 'y' => 200]
]);

// Stop and get data
$sessionData = $replayService->stopRecording($sessionKey);

use LaravelGPT\DataBreach\Livewire\PasswordChecker;

// In your Blade view
<livewire:data-breach::password-checker />

// New analytics components
<livewire:data-breach::cursor-analytics />
<livewire:data-breach::session-replay />

// In your Volt component
use function Livewire\Volt\{state, mount};

state(['password' => '', 'result' => null]);

mount(function () {
    // Component initialization
});

$checkPassword = function () {
    $service = app(PasswordBreachService::class);
    $this->result = $service->checkPassword($this->password);
};
bash
php artisan data-breach:install