#4: URL generation for an album now uses all parent albums to form a complete path
This commit is contained in:
parent
7ea1dc5c83
commit
e0773ba236
@ -146,7 +146,19 @@ class Album extends Model
|
||||
|
||||
public function url()
|
||||
{
|
||||
return route('viewAlbum', $this->url_alias);
|
||||
$parts = [];
|
||||
$current = $this;
|
||||
|
||||
while (!is_null($current))
|
||||
{
|
||||
$parts[] = $current->url_alias;
|
||||
|
||||
$current = $current->parent;
|
||||
}
|
||||
|
||||
$parts = array_reverse($parts);
|
||||
|
||||
return route('viewAlbum', join('/', $parts));
|
||||
}
|
||||
|
||||
public function userPermissions()
|
||||
|
Loading…
Reference in New Issue
Block a user