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 anonymizePrivacySubject
Section titled “Action anonymizePrivacySubject”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runAnonymizePrivacySubject(\Illuminate\Database\Eloquent\Model $subject): int{ return \Capell\PrivacyCenter\Actions\AnonymizePrivacySubjectAction::run($subject);}Action applyRetentionRule
Section titled “Action applyRetentionRule”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runApplyRetentionRule(\Capell\PrivacyCenter\Models\RetentionRule $rule, ?\Carbon\CarbonInterface $now = null, bool $dryRun = false): \Capell\PrivacyCenter\Data\RetentionExecutionResultData{ return \Capell\PrivacyCenter\Actions\ApplyRetentionRuleAction::run($rule, $now, $dryRun);}Action applyRetentionRules
Section titled “Action applyRetentionRules”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runApplyRetentionRules(?\Carbon\CarbonInterface $now = null): \Illuminate\Support\Collection{ return \Capell\PrivacyCenter\Actions\ApplyRetentionRulesAction::run($now);}Action buildPrivacyCenterOverviewStats
Section titled “Action buildPrivacyCenterOverviewStats”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runBuildPrivacyCenterOverviewStats(): array{ return \Capell\PrivacyCenter\Actions\BuildPrivacyCenterOverviewStatsAction::run();}Action buildPrivacyExport
Section titled “Action buildPrivacyExport”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runBuildPrivacyExport(\Illuminate\Database\Eloquent\Model $subject): \Capell\PrivacyCenter\Data\PrivacyExportData{ return \Capell\PrivacyCenter\Actions\BuildPrivacyExportAction::run($subject);}Action createRetentionRule
Section titled “Action createRetentionRule”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runCreateRetentionRule(\Capell\PrivacyCenter\Data\RetentionRuleData $ruleData): \Capell\PrivacyCenter\Models\RetentionRule{ return \Capell\PrivacyCenter\Actions\CreateRetentionRuleAction::run($ruleData);}Action markPrivacyRequestFulfilled
Section titled “Action markPrivacyRequestFulfilled”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runMarkPrivacyRequestFulfilled(\Capell\PrivacyCenter\Models\PrivacyRequest $privacyRequest, array $workflowPayload = [], ?\Carbon\CarbonInterface $fulfilledAt = null): \Capell\PrivacyCenter\Models\PrivacyRequest{ return \Capell\PrivacyCenter\Actions\MarkPrivacyRequestFulfilledAction::run($privacyRequest, $workflowPayload, $fulfilledAt);}Action openPrivacyRequest
Section titled “Action openPrivacyRequest”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runOpenPrivacyRequest(\Capell\PrivacyCenter\Data\PrivacyRequestData $requestData, ?\Illuminate\Database\Eloquent\Model $requester = null, ?\Illuminate\Database\Eloquent\Model $subject = null): \Capell\PrivacyCenter\Models\PrivacyRequest{ return \Capell\PrivacyCenter\Actions\OpenPrivacyRequestAction::run($requestData, $requester, $subject);}Action recordConsent
Section titled “Action recordConsent”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runRecordConsent(\Capell\PrivacyCenter\Data\ConsentRecordData $consentData, ?\Illuminate\Database\Eloquent\Model $subject = null, ?\Illuminate\Database\Eloquent\Model $source = null): \Capell\PrivacyCenter\Models\ConsentRecord{ return \Capell\PrivacyCenter\Actions\RecordConsentAction::run($consentData, $subject, $source);}Action recordPolicyAcceptance
Section titled “Action recordPolicyAcceptance”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runRecordPolicyAcceptance(\Capell\PrivacyCenter\Data\PolicyAcceptanceData $acceptanceData, ?\Illuminate\Database\Eloquent\Model $subject = null): \Capell\PrivacyCenter\Models\PolicyAcceptance{ return \Capell\PrivacyCenter\Actions\RecordPolicyAcceptanceAction::run($acceptanceData, $subject);}Action registerConsentPolicy
Section titled “Action registerConsentPolicy”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\PrivacyCenter;
function runRegisterConsentPolicy(\Capell\PrivacyCenter\Data\ConsentPolicyData $policyData): \Capell\PrivacyCenter\Models\ConsentPolicy{ return \Capell\PrivacyCenter\Actions\RegisterConsentPolicyAction::run($policyData);}