- 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.
51 lines
1.1 KiB
PHP
51 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Repositories\Module\HostingAccount;
|
|
|
|
use App\Models\ModuleHostingAccount;
|
|
use App\Repositories\BaseRepository;
|
|
|
|
class HostingAccountRepository extends BaseRepository implements HostingAccountRepositoryInterface
|
|
{
|
|
public function getModel()
|
|
{
|
|
return ModuleHostingAccount::class;
|
|
}
|
|
|
|
public function filter(
|
|
array $data = [],
|
|
array $relationships = [],
|
|
array $withCount = [],
|
|
array $select = ['*'],
|
|
bool $returnQuery = false
|
|
) {
|
|
$query = $this->model
|
|
->select($select)
|
|
->with($relationships);
|
|
|
|
if (!empty($data['customer_id'])) {
|
|
$query->where('customer_id', $data['customer_id']);
|
|
}
|
|
|
|
if (!empty($data['status'])) {
|
|
$query->where('status', $data['status']);
|
|
}
|
|
|
|
if (!empty($withCount)) {
|
|
$query->withCount($withCount);
|
|
}
|
|
|
|
if ($returnQuery) {
|
|
return $query;
|
|
}
|
|
|
|
if (!empty($data['paginate'])) {
|
|
return $query->paginate(
|
|
$data['per_page'] ?? 15
|
|
);
|
|
}
|
|
|
|
return $query->get();
|
|
}
|
|
}
|