Passed
Push — master ( 5f0beb...cbeb67 )
by Brian
02:41
created

ProfileUpdateRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 10
1
<?php
2
3
namespace App\Http\Requests\Admin;
4
5
use App\Models\Admin;
6
use Illuminate\Foundation\Http\FormRequest;
7
use Illuminate\Validation\Rule;
8
9
class ProfileUpdateRequest extends FormRequest
10
{
11
    /**
12
     * Get the validation rules that apply to the request.
13
     *
14
     * @return array<string, \Illuminate\Contracts\Validation\Rule|array|string>
15
     */
16 2
    public function rules(): array
17
    {
18 2
        return [
19 2
            'name' => ['string', 'max:255'],
20 2
            'email' => ['email', 'max:255', Rule::unique(Admin::class)->ignore($this->user('admin')->id)],
21 2
        ];
22
    }
23
}
24