EmailVerificationProcessRequest::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Auth\Http\Requests\Frontarea;
6
7
class EmailVerificationProcessRequest extends EmailVerificationRequest
8
{
9
    /**
10
     * Get the validation rules that apply to the request.
11
     *
12
     * @return array
13
     */
14
    public function rules(): array
15
    {
16
        return [
17
            // Do not validate `token` here since at this stage we can NOT generate viewable error,
18
            // and it is been processed in the controller through EmailVerificationBroker anyway
19
            //'token' => 'required|regex:/^([0-9a-f]*)$/',
20
            'email' => 'required|email|min:3|max:150|exists:'.config('cortex.auth.tables.members').',email',
21
        ];
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected function getRedirectUrl()
28
    {
29
        return $this->redirector->getUrlGenerator()->route('frontarea.verification.email.request');
30
    }
31
}
32