X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/391478465ab5970ad19649d41a3f8c7816efb294..refs/pull/5721/head:/app/Api/ApiToken.php diff --git a/app/Api/ApiToken.php b/app/Api/ApiToken.php index 5c2d591e4..ca89c813e 100644 --- a/app/Api/ApiToken.php +++ b/app/Api/ApiToken.php @@ -52,4 +52,12 @@ class ApiToken extends Model implements Loggable { return "({$this->id}) {$this->name}; User: {$this->user->logDescriptor()}"; } + + /** + * Get the URL for managing this token. + */ + public function getUrl(string $path = ''): string + { + return url("/http/source.bookstackapp.com/api-tokens/{$this->user_id}/{$this->id}/" . trim($path, '/')); + } }