12345678910111213141516171819202122 |
- <?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',
- ];
- }
- }
|