PHP code example of jeffersongoncalves / laravel-hunter

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

    

jeffersongoncalves / laravel-hunter example snippets


// config/hunter.php
return [
    'api_key' => env('HUNTER_API_KEY'),
    'base_url' => env('HUNTER_BASE_URL', 'https://api.hunter.io/v2'),
];

use JeffersonGoncalves\Hunter\Facades\Hunter;
use JeffersonGoncalves\Hunter\Exceptions\HunterException;

Hunter::domainSearch('example.com', limit: 10, type: 'personal');
Hunter::emailCount('example.com', type: 'personal');

Hunter::findEmail('example.com', 'Jane', 'Doe');
Hunter::verifyEmail('[email protected]');

Hunter::accountInfo();

Hunter::listLeads(limit: 10, offset: 0);
Hunter::getLead('lead-id');
Hunter::createLead('[email protected]', firstName: 'Jane', lastName: 'Doe', company: 'Acme');
Hunter::deleteLead('lead-id');

Hunter::listCampaigns(limit: 10, offset: 0);
Hunter::getCampaign('campaign-id');
Hunter::startCampaign('campaign-id');
Hunter::pauseCampaign('campaign-id');

Hunter::listLeadsLists(limit: 10, offset: 0);
Hunter::getLeadsList('list-id');

try {
    $result = Hunter::findEmail('example.com', 'Jane', 'Doe');
} catch (HunterException $e) {
    // $e->getMessage() — the API's errors[0].details, or the raw response body
    // $e->statusCode  — the HTTP status code returned by Hunter.io
} catch (InvalidArgumentException $e) {
    // a 
bash
php artisan vendor:publish --tag="hunter-config"
bash
composer analyse