Extension and action examples
Use the action functions with records and Data objects supplied by your application. They pass each argument to the package operation and return its result.
These adapters show container registration. Use the owning package registry when a contract requires contributor discovery.
Contract adapters wrap an existing implementation. Call their registration function from your service provider with that implementation; tagged contracts keep their declared tag. Resolve the backend by its concrete class before registration so the replacement contract does not resolve itself. Static contract metadata uses one backend class per adapter.
Action anonymizeContact
Section titled “Action anonymizeContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runAnonymizeContact(\Capell\Contacts\Models\Contact $contact, ?\Illuminate\Contracts\Auth\Authenticatable $actor = null): \Capell\Contacts\Models\Contact{ return \Capell\Contacts\Actions\AnonymizeContactAction::run($contact, $actor);}Action anonymizeContactWithAudit
Section titled “Action anonymizeContactWithAudit”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runAnonymizeContactWithAudit(\Capell\Contacts\Models\Contact $contact, ?string $requestedBy = null, ?\Illuminate\Contracts\Auth\Authenticatable $actor = null): \Capell\Contacts\Models\Contact{ return \Capell\Contacts\Actions\AnonymizeContactWithAuditAction::run($contact, $requestedBy, $actor);}Action auditContactPrivacyExport
Section titled “Action auditContactPrivacyExport”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runAuditContactPrivacyExport(\Capell\Contacts\Models\Contact $contact, ?string $requestedBy = null, ?\Illuminate\Contracts\Auth\Authenticatable $actor = null): array{ return \Capell\Contacts\Actions\AuditContactPrivacyExportAction::run($contact, $requestedBy, $actor);}Action buildContactPrivacyExport
Section titled “Action buildContactPrivacyExport”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runBuildContactPrivacyExport(\Capell\Contacts\Models\Contact $contact, ?\Illuminate\Contracts\Auth\Authenticatable $actor = null): array{ return \Capell\Contacts\Actions\BuildContactPrivacyExportAction::run($contact, $actor);}Action buildContactsOverviewStats
Section titled “Action buildContactsOverviewStats”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runBuildContactsOverviewStats(?int $siteId = null): array{ return \Capell\Contacts\Actions\BuildContactsOverviewStatsAction::run($siteId);}Action findOrCreateContact
Section titled “Action findOrCreateContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runFindOrCreateContact(\Capell\Contacts\Data\ContactIdentityData $identity, ?\Illuminate\Database\Eloquent\Model $source = null): \Capell\Contacts\Models\Contact{ return \Capell\Contacts\Actions\FindOrCreateContactAction::run($identity, $source);}Action recordContactActivity
Section titled “Action recordContactActivity”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runRecordContactActivity(\Capell\Contacts\Models\Contact $contact, \Capell\Contacts\Data\ContactActivityData $activityData, ?\Illuminate\Database\Eloquent\Model $subject = null, ?\Capell\Contacts\Models\Lead $lead = null, ?\Capell\Contacts\Models\Organisation $organisation = null): \Capell\Contacts\Models\ContactActivity{ return \Capell\Contacts\Actions\RecordContactActivityAction::run($contact, $activityData, $subject, $lead, $organisation);}Action syncAccessGateRegistrationContact
Section titled “Action syncAccessGateRegistrationContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncAccessGateRegistrationContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncAccessGateRegistrationContactAction::run($event);}Action syncCampaignConversionContact
Section titled “Action syncCampaignConversionContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncCampaignConversionContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncCampaignConversionContactAction::run($event);}Action syncCommentContact
Section titled “Action syncCommentContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncCommentContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncCommentContactAction::run($event);}Action syncContactSourceRecord
Section titled “Action syncContactSourceRecord”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncContactSourceRecord(\Capell\Contacts\Data\ContactSourceRecordData $record, ?\Illuminate\Database\Eloquent\Model $source = null, ?\Capell\Contacts\Models\Organisation $organisation = null): \Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncContactSourceRecordAction::run($record, $source, $organisation);}Action syncEventRegistrationContact
Section titled “Action syncEventRegistrationContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncEventRegistrationContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncEventRegistrationContactAction::run($event);}Action syncFormSubmissionContact
Section titled “Action syncFormSubmissionContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncFormSubmissionContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncFormSubmissionContactAction::run($event);}Action syncShopifyCustomerContact
Section titled “Action syncShopifyCustomerContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runSyncShopifyCustomerContact(object $event): ?\Capell\Contacts\Data\ContactSourceSyncResultData{ return \Capell\Contacts\Actions\SyncShopifyCustomerContactAction::run($event);}Action tagContact
Section titled “Action tagContact”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\Contacts;
function runTagContact(\Capell\Contacts\Models\Contact $contact, array|string $tags): \Capell\Contacts\Models\Contact{ return \Capell\Contacts\Actions\TagContactAction::run($contact, $tags);}