Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 64d5ce0

Browse files
authored
Added Support for OptionalDeep in determineEntryUrl (#188)
1 parent 474b651 commit 64d5ce0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/RapidezStatamic.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Rapidez\Statamic;
44

55
use Illuminate\Support\Facades\Cache;
6+
use Rapidez\BladeDirectives\OptionalDeep;
67
use Statamic\Statamic;
78
use Statamic\Eloquent\Entries\Entry;
89
use Rapidez\Core\Facades\Rapidez;
@@ -64,10 +65,14 @@ protected function buildTree(array $items, string $nav): array
6465
return $tree;
6566
}
6667

67-
public function determineEntryUrl(Entry|Page|string $entry, string $nav = 'global-link'): string
68+
public function determineEntryUrl(Entry|Page|string|OptionalDeep $entry, string $nav = 'global-link'): string
6869
{
6970
$cacheKey = $nav . '-' . config('rapidez.store');
7071

72+
if ($entry instanceof OptionalDeep) {
73+
$entry = $entry->get();
74+
}
75+
7176
if (is_string($entry)) {
7277
return $entry;
7378
}

0 commit comments

Comments
 (0)