cms-frontend/app/Services/Api/UserManagementService.php

36 lines
780 B
PHP

<?php
namespace App\Services\Api;
class UserManagementService extends BaseApiService
{
public function getAllUsers(array $params = [])
{
return $this->get('/users', $params);
}
public function getUser($id)
{
return $this->get("/users/{$id}");
}
public function createUser(array $data)
{
return $this->post('/users', $data);
}
public function updateUser($id, array $data)
{
return $this->post("/users/{$id}", array_merge($data, ['_method' => 'PUT']));
}
public function deleteUser($id)
{
return $this->post("/users/{$id}", ['_method' => 'DELETE']);
}
public function changePassword(array $data)
{
return $this->post('/users/change-password', $data);
}
}