PHP code example of mischasigtermans / laravel-sift

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

    

mischasigtermans / laravel-sift example snippets


use Sift;

Sift::domain('[email protected]'); // Returns 'example.com'

// By default, public email domains are filtered:
Sift::domain('[email protected]'); // Returns null

// Allow public domains explicitly:
Sift::domain('[email protected]', true); // Returns 'gmail.com'

// Business email remains unaffected:
Sift::domain('[email protected]'); // Returns 'company.com'

Sift::isCommon('gmail.com'); // true
Sift::isCommon('[email protected]'); // false
Sift::isCommon('invalid-email'); // null

return [
    'additional_domains' => [
        // 'example.org', 'testmail.com'
    ],
    'common_domains' => [
        'gmail.com', 'yahoo.com', 'outlook.com', 'hotmail.com', 'icloud.com',
        'protonmail.com', 'zoho.com', 'gmx.com', 'aol.com', 'yandex.com', 
        'qq.com', 'live.com', 'rediffmail.com', 'mail.com', 'bigmir.net',
        // (Full list continues...)
    ],
];
sh
php artisan vendor:publish --tag=sift-config