Skip to content

Commit 578815a

Browse files
Cannonb4llclaude
andcommitted
Add path parameter to AuthUser::create() (#70)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e53f948 commit 578815a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ Available methods for auth users:
443443
// Create auth user
444444
$ploi->servers(123)->sites(123)->authUser()->create(
445445
$name,
446-
$password
446+
$password,
447+
$path = null // e.g. '/wp-admin' to protect a specific path
447448
);
448449

449450
// List auth users

src/Ploi/Resources/AuthUser.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,13 @@ public function get(?int $id = null): Response
5050
: $this->getPloi()->makeAPICall($this->getEndpoint());
5151
}
5252

53-
public function create(string $name, string $password): Response
53+
public function create(string $name, string $password, ?string $path = null): Response
5454
{
5555
$options = [
5656
'body' => json_encode([
5757
'name' => $name,
5858
'password' => $password,
59+
'path' => $path,
5960
]),
6061
];
6162

0 commit comments

Comments
 (0)