Worked extension examples
These developer-facing recipes are kept beside the package contract. Replace the example values with the site-specific records and data objects used by the calling workflow.
<?phpdeclare(strict_types=1);final class ExampleCountableReleaseWorkspaceItemContributorImplementation implements \Capell\PublishingStudio\Contracts\CountableReleaseWorkspaceItemContributor{ public function countFor(\Capell\PublishingStudio\Models\Workspace $workspace): int { throw new LogicException('Implement this package contract for the calling site.'); } /** * @return list<ReleaseWorkspaceItemData> */ public function limitedItemsFor(\Capell\PublishingStudio\Models\Workspace $workspace, ?int $limit = null): array { throw new LogicException('Implement this package contract for the calling site.'); }}
app()->bind(\Capell\PublishingStudio\Contracts\CountableReleaseWorkspaceItemContributor::class, ExampleCountableReleaseWorkspaceItemContributorImplementation::class);<?phpdeclare(strict_types=1);final class ExampleEditorialCalendarEventContributorImplementation implements \Capell\PublishingStudio\Contracts\EditorialCalendarEventContributor{ /** * @return iterable<EditorialCalendarEventData> */ public function editorialCalendarEvents(\Capell\PublishingStudio\Data\EditorialCalendarQueryData $query): iterable { throw new LogicException('Implement this package contract for the calling site.'); }}
app()->bind(\Capell\PublishingStudio\Contracts\EditorialCalendarEventContributor::class, ExampleEditorialCalendarEventContributorImplementation::class);<?phpdeclare(strict_types=1);final class ExampleReleaseWorkspaceItemContributorImplementation implements \Capell\PublishingStudio\Contracts\ReleaseWorkspaceItemContributor{ /** * @return list<ReleaseWorkspaceItemData> */ public function itemsFor(\Capell\PublishingStudio\Models\Workspace $workspace): array { throw new LogicException('Implement this package contract for the calling site.'); }}
app()->bind(\Capell\PublishingStudio\Contracts\ReleaseWorkspaceItemContributor::class, ExampleReleaseWorkspaceItemContributorImplementation::class);<?phpdeclare(strict_types=1);final class ExampleWorkspaceTableActionContributorImplementation implements \Capell\PublishingStudio\Contracts\WorkspaceTableActionContributor{ /** * @return array<int, Action|ActionGroup> */ public function actions(): array { throw new LogicException('Implement this package contract for the calling site.'); }}
app()->bind(\Capell\PublishingStudio\Contracts\WorkspaceTableActionContributor::class, ExampleWorkspaceTableActionContributorImplementation::class);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\DashboardReports\BuildContentSchedulerEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\BuildEditorialCalendarEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\BuildSchedulerIcalFeedAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\DashboardReports\BuildVisibleContentSchedulerEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\DashboardReports\BuildVisibleEditorialCalendarEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\CancelSchedulerEventAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\CreateSchedulerIcalTokenAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\ExecuteSchedulerEventAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\InstallPublishingStudioPackageAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\RunDueSchedulerEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\SetWorkspaceSchedulerMetadataAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\SyncWorkspaceSchedulerEventsAction::class)->handle(...$inputs);<?phpdeclare(strict_types=1);$inputs = []; // Supply the arguments required by the action handle() method.resolve(\Capell\PublishingStudio\Actions\ValidateWorkspaceSchedulerMetadataAction::class)->handle(...$inputs);