PHP code example of ariaieboy / laravel-safe-browsing

1. Go to this page and download the library: Download ariaieboy/laravel-safe-browsing 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/ */

    

ariaieboy / laravel-safe-browsing example snippets


return [
    'google'=>[
        'api_domain'=>env('SAFEBROWSING_GOOGLE_API_DOMAIN','https://safebrowsing.googleapis.com/'),
        'api_key'=>env('SAFEBROWSING_GOOGLE_API_KEY',null),
        'timeout'=>30,
        'threatTypes' => [
            'THREAT_TYPE_UNSPECIFIED',
            'MALWARE',
            'SOCIAL_ENGINEERING',
            'UNWANTED_SOFTWARE',
            'POTENTIALLY_HARMFUL_APPLICATION',
        ],

        'threatPlatforms' => [
            'ANY_PLATFORM'
        ],
        'clientId' => 'ariaieboy-safebrowsing',
        'clientVersion' => '1.0.0',
    ]
];




    $result = LaravelSafeBrowsing::isSafeUrl('http://malware.testing.google.test/testing/malware/',true);
    // Return: (string) MALWARE
bash)

[//]: # (php artisan vendor:publish --tag="laravel-safe-browsing_without_prefix-migrations")

[//]: # (php artisan migrate)

[//]: # (
bash
php artisan vendor:publish --tag="safe-browsing-config"