Skip to content

Commit

Permalink
feat: add PageSiblings
Browse files Browse the repository at this point in the history
  • Loading branch information
evolkmann committed Jan 25, 2025
1 parent 97eb3c0 commit a75742e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 51 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "volkmann-design-code/kirby-utils",
"description": "Utility functions for Kirby Projects",
"homepage": "https://github.com/volkmann-design-code/kirby-utils",
"version": "0.6.0",
"version": "0.7.0",
"type": "kirby-plugin",
"scripts": {
"test": "phpunit tests"
Expand Down
100 changes: 50 additions & 50 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/Traits/PageSiblings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace VolkmannDesignCode\KirbyUtils\Traits;

use Kirby\Cms\Collection;

trait PageSiblings
{
public function siblingsIncludingDrafts(): Collection
{
return $this->parentModel()->childrenAndDrafts()->not($this);
}
}

0 comments on commit a75742e

Please sign in to comment.