UpdateFooterRequest::authorize()   A
last analyzed

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
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php namespace Arcanesoft\Seo\Http\Requests\Admin\Footers;
2
3
/**
4
 * Class     UpdateFooterRequest
5
 *
6
 * @package  Arcanesoft\Seo\Http\Requests\Admin\Footers
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class UpdateFooterRequest extends FooterFormRequest
10
{
11
    /* -----------------------------------------------------------------
12
     |  Main Methods
13
     | -----------------------------------------------------------------
14
     */
15
16
    /**
17
     * Determine if the user is authorized to make this request.
18
     *
19
     * @return bool
20
     */
21
    public function authorize()
22
    {
23
        return true;
24
    }
25
26
    /**
27
     * Get the validation rules that apply to the request.
28
     *
29
     * @return array
30
     */
31
    public function rules()
32
    {
33
        $footer = $this->route('seo_footer');
34
35
        return [
36
            // Footer Rules
37
            'name'            => ['required', 'string'],
38
            'localization'    => ['required', 'string'],
39
            'uri'             => ['required', 'string', $this->getUniqueUriRule()->ignore($footer->id)],
40
            'locale'          => $this->getLocaleRule(),
41
            'page'            => $this->getPageRule(),
42
            // SEO Rules
43
            'seo_title'       => ['required', 'string'],
44
            'seo_description' => ['required', 'string'],
45
            'seo_keywords'    => ['required', 'array', 'min:1'],
46
        ];
47
    }
48
}
49