- Added PleskDomainService for managing domain operations (create, update, remove, get info). - Introduced PleskHostingService for provisioning hosting accounts and notifying customers. - Created PleskService for handling API requests to Plesk. - Added migration to include 'type' column in dns_manager_servers table. - Created migration for module_hosting_accounts table to track hosting subscriptions. - Created migration for module_hosting_plesk_clients table to manage Plesk client credentials. - Added email templates for notifying customers and admins about hosting account creation.
49 lines
1.3 KiB
PHP
49 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Repositories\Module\HostingAccount;
|
|
|
|
use App\Repositories\BaseCachedRepository;
|
|
use Illuminate\Support\Facades\Cache;
|
|
|
|
class HostingAccountCachedRepository extends BaseCachedRepository implements HostingAccountRepositoryInterface
|
|
{
|
|
public function __construct(
|
|
public HostingAccountRepository $hostingAccountRepository
|
|
) {
|
|
parent::__construct();
|
|
}
|
|
|
|
public function getModel()
|
|
{
|
|
return $this->hostingAccountRepository->getModel();
|
|
}
|
|
|
|
public function filter(
|
|
array $data = [],
|
|
array $relationships = [],
|
|
array $withCount = [],
|
|
array $select = ['*'],
|
|
bool $returnQuery = false
|
|
) {
|
|
if (
|
|
$returnQuery ||
|
|
!empty($data['paginate'])
|
|
) {
|
|
return $this->hostingAccountRepository
|
|
->filter($data, $relationships, $withCount, $select, $returnQuery);
|
|
}
|
|
|
|
$cacheKey = $this->getCacheKey(md5(json_encode([
|
|
'filter' => compact('data', 'relationships', 'withCount', 'select')
|
|
])));
|
|
|
|
return Cache::remember(
|
|
$cacheKey,
|
|
$this->cacheTime,
|
|
fn() =>
|
|
$this->hostingAccountRepository
|
|
->filter($data, $relationships, $withCount, $select, $returnQuery)
|
|
);
|
|
}
|
|
}
|