From fd1d03b44c915e8b68dd9944c9c772272a6d53f7 Mon Sep 17 00:00:00 2001 From: Jonas Siewertsen Date: Sat, 27 Jun 2020 12:48:22 +0200 Subject: [PATCH] Fix Video helper --- config/config.php | 4 +- src/Helper/Documentation.php | 72 ------------------------------------ src/Helper/Video.php | 2 +- 3 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 src/Helper/Documentation.php diff --git a/config/config.php b/config/config.php index a0b0b95..3726171 100644 --- a/config/config.php +++ b/config/config.php @@ -13,7 +13,7 @@ | */ - 'collection' => 'how_to_addon_documentation', - 'blueprint' => 'how_to_addon_documentation', + 'collection' => 'how_to_addon_videos', + 'blueprint' => 'how_to_addon_videos', ]; diff --git a/src/Helper/Documentation.php b/src/Helper/Documentation.php deleted file mode 100644 index 6dc580b..0000000 --- a/src/Helper/Documentation.php +++ /dev/null @@ -1,72 +0,0 @@ -structure() - ->in(Site::selected()->handle())->tree(); - - return collect($tree); - } - - /** - * Fetch the belonging children for the navigation - */ - public static function entryChildren($tree, $nav): LaravelCollection - { - if (! isset($tree['children'])) { - return collect(); - } - - return collect($tree['children'])->map(function ($child) use ($nav, $tree) { - return $nav->item(self::entryTitle($child['entry'])) - ->route('howToAddon.documentation.child.show', [ - 'parent' => Documentation::entrySlug($tree['entry']), - 'slug' => Documentation::entrySlug($child['entry']) - ]); - }); - } - - /** - * Fetch the belonging children for the navigation - */ - public static function exists(): bool - { - return Collection::handleExists(self::collectionName()); - } - - /** - * Return the entry title - */ - public static function entryTitle($entry): string - { - return Entry::find($entry)->title; - } - - /** - * Return the slug - */ - public static function entrySlug($entry): string - { - return Entry::find($entry)->slug(); - } - - /** - * Return the documentation collection name - */ - public static function collectionName(): string - { - return config('howToAddon.collection.documentation', 'how_to_addon_documentation'); - } -} diff --git a/src/Helper/Video.php b/src/Helper/Video.php index 71f218d..29f0a63 100644 --- a/src/Helper/Video.php +++ b/src/Helper/Video.php @@ -9,6 +9,6 @@ class Video */ public static function collectionName(): string { - return config('howToAddon.collection.videos', 'how_to_addon_videso'); + return config('howToAddon.collection', 'how_to_addon_videos'); } }