Skip to content

Commit

Permalink
Fix parent path
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraelOrtuno committed Jan 21, 2019
1 parent 9dc5660 commit 1eabd82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PermalinkFormComposer.php
Expand Up @@ -4,6 +4,7 @@

use Devio\Permalink\HasPermalinks;
use Illuminate\Contracts\View\View;
use Devio\Permalink\Services\NestingService;

class PermalinkFormComposer
{
Expand Down Expand Up @@ -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))
: '';
}

/**
Expand Down

0 comments on commit 1eabd82

Please sign in to comment.