X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/5280/head:/app/Api/ApiToken.php diff --git a/app/Api/ApiToken.php b/app/Api/ApiToken.php index defaa7e95..ca89c813e 100644 --- a/app/Api/ApiToken.php +++ b/app/Api/ApiToken.php @@ -1,25 +1,31 @@ - 'date:Y-m-d' + 'expires_at' => 'date:Y-m-d', ]; /** @@ -40,10 +46,18 @@ class ApiToken extends Model implements Loggable } /** - * @inheritdoc + * {@inheritdoc} */ public function logDescriptor(): string { return "({$this->id}) {$this->name}; User: {$this->user->logDescriptor()}"; } + + /** + * Get the URL for managing this token. + */ + public function getUrl(string $path = ''): string + { + return url("/https/source.bookstackapp.com/api-tokens/{$this->user_id}/{$this->id}/" . trim($path, '/')); + } }