mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
23 lines
519 B
PHP
23 lines
519 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Admin;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CertRequest extends FormRequest
|
|
{
|
|
public function rules()
|
|
{
|
|
$unq_domain = '';
|
|
if (in_array($this->method(), ['PATCH', 'PUT'], true)) {
|
|
$unq_domain = ','.$this->cert->id;
|
|
}
|
|
|
|
return [
|
|
'domain' => 'required|string|unique:node_certificate,domain'.$unq_domain,
|
|
'key' => 'string|nullable',
|
|
'pem' => 'string|nullable',
|
|
];
|
|
}
|
|
}
|