Completed
Push — master ( c6be7b...ac3a6a )
by claudio
03:59
created

EmployeeRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
3
namespace plunner\Http\Requests\Companies\Groups;
4
5
use plunner\Company;
6
use plunner\Http\Requests\Request;
7
8
class EmployeeRequest extends Request
9
{
10
    /**
11
     * Determine if the user is authorized to make this request.
12
     *
13
     * @return bool
14
     */
15 6
    public function authorize()
16
    {
17 6
        return true;
18
    }
19
20
    /**
21
     * Get the validation rules that apply to the request.
22
     *
23
     * @return array
24
     */
25 6
    public function rules()
26
    {
27
        return [
28 6
            'id' => 'required|array|exists:employees,id,company_id,'.$this->user()->id,
29 6
        ];
30
    }
31
}
32