Passed
Push — master ( c12a7e...1e568f )
by Brian
02:51
created

ProfileUpdateRequest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 12
ccs 0
cts 4
cp 0
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A rules() 0 5 1
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
    public function rules(): array
17
    {
18
        return [
19
            'name' => ['string', 'max:255'],
20
            'email' => ['email', 'max:255', Rule::unique(Admin::class)->ignore($this->user('admin')->id)],
21
        ];
22
    }
23
}
24