<?php namespace BookStack\Auth;
use BookStack\Api\ApiToken;
+use BookStack\Entities\Tools\SlugGenerator;
use BookStack\Interfaces\Loggable;
use BookStack\Interfaces\Sluggable;
use BookStack\Model;
*/
public function getProfileUrl(): string
{
- return url('/user/' . $this->id);
+ return url('/user/' . $this->slug);
}
/**
{
return "({$this->id}) {$this->name}";
}
+
+ /**
+ * @inheritDoc
+ */
+ public function refreshSlug(): string
+ {
+ $this->slug = app(SlugGenerator::class)->generate($this);
+ return $this->slug;
+ }
}