]> BookStack Code Mirror - bookstack/blobdiff - app/Api/ApiToken.php
API Tokens: Updated interfaces to return to correct location
[bookstack] / app / Api / ApiToken.php
index 5c2d591e4083783d2ca6e75f86a0263ef38d9ec3..ca89c813ed09be449376a22c8a1a739c0b94977e 100644 (file)
@@ -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("/api-tokens/{$this->user_id}/{$this->id}/" . trim($path, '/'));
+    }
 }