// get all contacts and sort them by email in asc order and by last name in desc order
$contacts = $ac->contacts()->order(['email' => 'asc', 'lastName' => 'desc'])->all();
// get contacts where first name is equal to John
$contacts = $ac->contacts()->filter(['firstName' => 'john'])->all();
$ac->tags()->query(['foo' => 'bar'])->all();
// get tag with ID == 1
$tag = $ac->tags()->get(1);
// skip 10 tags and get next 50 tags, also order them by description
$tags = $ac->tags()->orderby(['description' => 'asc'])->paginate(50, 10)->all();
// get contact where email is equal to '[email protected]'
$contact = $ac->contacts()->getByEmail('[email protected]');
// create new contact
$ac->contacts()->create([
'email' => '[email protected]',
'firstName' => 'John',
'lastName' => 'Doe',
'phone' => '7223224241'
]);
// create new tag
$ac->tags()->create([
'tag' => 'My Tag',
'tagType' => 'contact',
'description' => 'Description'
]);
// add tag to contact
$ac->contacts()->addTag([
'contact' => '1', // contact ID
'tag' => '20' // tag ID
]);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.