Passed
Push — develop ( 3db2fb...b27e40 )
by Septianata
05:11
created

StoreRequest::rules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 8
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace App\Http\Requests\Branch;
4
5
use App\Infrastructure\Foundation\Http\FormRequest;
6
7
class StoreRequest extends FormRequest
8
{
9
    /**
10
     * {@inheritDoc}
11
     */
12 1
    public function authorize()
13
    {
14 1
        return !is_null($this->user());
15
    }
16
17
    /**
18
     * {@inheritDoc}
19
     */
20 1
    public function rules()
21
    {
22
        return [
23 1
            'name' => 'required|string|max:255|unique:branches',
24
            'address' => 'required|string',
25
            'address_latitude' => 'required|numeric',
26
            'address_longitude' => 'required|numeric',
27
            'google_map_url' => 'sometimes|nullable|string|max:255',
28
        ];
29
    }
30
}
31