Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
IsraelOrtuno committed Oct 8, 2018
1 parent c085e3c commit 9bdf84f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions src/Permalink.php
Expand Up @@ -248,11 +248,16 @@ public static function actionMap(array $map = null, $merge = true)
*/
public function setSeoAttribute($value)
{
$this->attributes['seo'] = json_encode(array_undot(
array_filter(array_dot($value), function ($item) {
return ! is_null($item);
})
));
if (! is_null($value)) {
$value = json_encode(array_undot(
array_filter(array_dot($value), function ($item) {
return ! is_null($item);
})
));
}


$this->attributes['seo'] = $value;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/PermalinkManager.php
Expand Up @@ -87,7 +87,7 @@ protected function getCurrentPermalink()
return $permalink;
}

return $this->staticPermalinks[$route->getName()] ?? null;
return (new Permalink)->fill(['seo' => $this->staticPermalinks[$route->getName()] ?? null]);
}

/**
Expand Down

0 comments on commit 9bdf84f

Please sign in to comment.