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 buildAiReadableKnowledgeBaseOutput
Section titled “Action buildAiReadableKnowledgeBaseOutput”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runBuildAiReadableKnowledgeBaseOutput(): \Illuminate\Support\Collection{ return \Capell\KnowledgeBase\Actions\BuildAiReadableKnowledgeBaseOutputAction::run();}Action buildKnowledgeBaseArticleSchema
Section titled “Action buildKnowledgeBaseArticleSchema”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runBuildKnowledgeBaseArticleSchema(\Capell\KnowledgeBase\Models\KnowledgeBaseArticle $article, ?string $canonicalUrl = null): ?array{ return \Capell\KnowledgeBase\Actions\BuildKnowledgeBaseArticleSchemaAction::run($article, $canonicalUrl);}Action buildKnowledgeBaseSearchDocuments
Section titled “Action buildKnowledgeBaseSearchDocuments”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runBuildKnowledgeBaseSearchDocuments(): \Illuminate\Support\Collection{ return \Capell\KnowledgeBase\Actions\BuildKnowledgeBaseSearchDocumentsAction::run();}Action buildPublicKnowledgeBaseArticleData
Section titled “Action buildPublicKnowledgeBaseArticleData”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runBuildPublicKnowledgeBaseArticleData(\Capell\KnowledgeBase\Models\KnowledgeBaseArticle $article): ?\Capell\KnowledgeBase\Data\PublicKnowledgeBaseArticleData{ return \Capell\KnowledgeBase\Actions\BuildPublicKnowledgeBaseArticleDataAction::run($article);}Action buildPublicKnowledgeBaseNavigation
Section titled “Action buildPublicKnowledgeBaseNavigation”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runBuildPublicKnowledgeBaseNavigation(): \Illuminate\Support\Collection{ return \Capell\KnowledgeBase\Actions\BuildPublicKnowledgeBaseNavigationAction::run();}Action createKnowledgeBaseArticle
Section titled “Action createKnowledgeBaseArticle”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runCreateKnowledgeBaseArticle(\Capell\KnowledgeBase\Data\CreateKnowledgeBaseArticleData $data): \Capell\KnowledgeBase\Models\KnowledgeBaseArticle{ return \Capell\KnowledgeBase\Actions\CreateKnowledgeBaseArticleAction::run($data);}Action createKnowledgeBaseArticleVersion
Section titled “Action createKnowledgeBaseArticleVersion”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runCreateKnowledgeBaseArticleVersion(\Capell\KnowledgeBase\Data\CreateKnowledgeBaseArticleVersionData $data): \Capell\KnowledgeBase\Models\KnowledgeBaseArticleVersion{ return \Capell\KnowledgeBase\Actions\CreateKnowledgeBaseArticleVersionAction::run($data);}Action pruneKnowledgeBaseHistory
Section titled “Action pruneKnowledgeBaseHistory”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runPruneKnowledgeBaseHistory(?int $retentionDays = null, ?int $versionsPerArticle = null): int{ return \Capell\KnowledgeBase\Actions\PruneKnowledgeBaseHistoryAction::run($retentionDays, $versionsPerArticle);}Action publishKnowledgeBaseArticleVersion
Section titled “Action publishKnowledgeBaseArticleVersion”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runPublishKnowledgeBaseArticleVersion(\Capell\KnowledgeBase\Models\KnowledgeBaseArticleVersion $version): \Capell\KnowledgeBase\Models\KnowledgeBaseArticle{ return \Capell\KnowledgeBase\Actions\PublishKnowledgeBaseArticleVersionAction::run($version);}Action recordKnowledgeBaseArticleFeedback
Section titled “Action recordKnowledgeBaseArticleFeedback”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runRecordKnowledgeBaseArticleFeedback(\Capell\KnowledgeBase\Data\RecordKnowledgeBaseArticleFeedbackData $data): \Capell\KnowledgeBase\Models\KnowledgeBaseArticleFeedback{ return \Capell\KnowledgeBase\Actions\RecordKnowledgeBaseArticleFeedbackAction::run($data);}Action relateKnowledgeBaseArticles
Section titled “Action relateKnowledgeBaseArticles”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runRelateKnowledgeBaseArticles(\Capell\KnowledgeBase\Models\KnowledgeBaseArticle $article, \Capell\KnowledgeBase\Models\KnowledgeBaseArticle $relatedArticle, \Capell\KnowledgeBase\Enums\KnowledgeBaseRelatedArticleType $relationType = \Capell\KnowledgeBase\Enums\KnowledgeBaseRelatedArticleType::Related, int $sortOrder = 0): \Capell\KnowledgeBase\Models\KnowledgeBaseRelatedArticle{ return \Capell\KnowledgeBase\Actions\RelateKnowledgeBaseArticlesAction::run($article, $relatedArticle, $relationType, $sortOrder);}Action seedKnowledgeBaseDemo
Section titled “Action seedKnowledgeBaseDemo”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\KnowledgeBase;
function runSeedKnowledgeBaseDemo(\Capell\KnowledgeBase\Data\SeedKnowledgeBaseDemoData $data): void{ \Capell\KnowledgeBase\Actions\SeedKnowledgeBaseDemoAction::run($data);}