PHP code example of jeffersongoncalves / laravel-apollo
1. Go to this page and download the library: Download jeffersongoncalves/laravel-apollo 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-apollo example snippets
// config/apollo.php
return [
'api_key' => env('APOLLO_API_KEY', ''),
'default_per_page' => env('APOLLO_DEFAULT_PER_PAGE', 25),
];
use JeffersonGoncalves\Apollo\Facades\Apollo;
// Search (supports titles, locations, seniorities, employee_ranges, keywords, page, per_page)
$people = Apollo::people()->search([
'titles' => 'CEO,CTO',
'locations' => 'United States,Canada',
'seniorities' => 'founder,c_suite',
'employee_ranges' => '1-10,11-50',
'keywords' => 'fintech',
'page' => 1,
]);
// Enrich by email, by LinkedIn URL, or by first name + domain
$person = Apollo::people()->enrich(['email' => '[email protected] ']);
$person = Apollo::people()->enrich(['linkedin' => 'https://linkedin.com/in/janedoe']);
$person = Apollo::people()->enrich(['first_name' => 'Jane', 'domain' => 'example.com']);
// Bulk enrich by email
$matches = Apollo::people()->bulkEnrich(['[email protected] ', '[email protected] ']);
$organizations = Apollo::organizations()->search([
'locations' => 'United States,Canada',
'employee_ranges' => '1-10,11-50',
'keywords' => 'fintech',
'page' => 1,
]);
$organization = Apollo::organizations()->enrich('example.com');
use JeffersonGoncalves\Apollo\Exceptions\ApolloException;
try {
Apollo::people()->enrich(['email' => '[email protected] ']);
} catch (ApolloException $e) {
logger()->error($e->getMessage(), $e->errorBody());
}
bash
php artisan vendor:publish --tag=apollo-config