Completed
Push — master ( fab3ca...481caa )
by ARCANEDEV
8s
created

FormRequest::authorize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
ccs 0
cts 2
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php namespace Arcanedev\Support\Http;
2
3
use Illuminate\Foundation\Http\FormRequest as BaseFormRequest;
4
5
/**
6
 * Class     FormRequest
7
 *
8
 * @package  Arcanedev\Support
9
 * @author   ARCANEDEV <[email protected]>
10
 *
11
 * @method  array  sanitize()
12
 */
13
abstract class FormRequest extends BaseFormRequest
14
{
15
    /* -----------------------------------------------------------------
16
     |  Main Methods
17
     | -----------------------------------------------------------------
18
     */
19
20
    /**
21
     * Determine if the user is authorized to make this request.
22
     *
23
     * @return bool
24
     */
25
    public function authorize()
26
    {
27
        return false;
28
    }
29
30
    /**
31
     * Get the validation rules that apply to the request.
32
     *
33
     * @return array
34
     */
35
    abstract public function rules();
36
37
    /**
38
     * Prepare the data for validation.
39
     */
40 6
    protected function prepareForValidation()
41
    {
42 6
        if (method_exists($this, 'sanitize')) {
43 6
            $this->merge($this->sanitize());
44 2
        }
45 6
    }
46
}
47