/** * updates input Page with a slug * @param Page $page */ static function updateSlug(Page $page) { $lang = $page->getLang(); $prefix = ""; if ($lang != null && $lang) { $prefix = $lang->getCode() . "/"; } $page->setSlug($prefix . Str::slug($page->getTitle())); }