From 1eabd8291c1af0316fc0d3b0ef6e57d17abbd016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Israel=20Ortu=C3=B1o?= Date: Mon, 21 Jan 2019 19:33:20 +0100 Subject: [PATCH] Fix parent path --- src/PermalinkFormComposer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/PermalinkFormComposer.php b/src/PermalinkFormComposer.php index 7cc9b3c..c6c1b51 100644 --- a/src/PermalinkFormComposer.php +++ b/src/PermalinkFormComposer.php @@ -4,6 +4,7 @@ use Devio\Permalink\HasPermalinks; use Illuminate\Contracts\View\View; +use Devio\Permalink\Services\NestingService; class PermalinkFormComposer { @@ -33,9 +34,9 @@ public function compose(View $view) */ protected function getPermalinkPath($permalink = null) { - return $permalink ? substr( - $permalink->final_path, 0, strrpos($permalink->final_path, "/") - ) : ''; + return $permalink + ? implode('/', NestingService::parentPath($permalink)) + : ''; } /**