UpdateRedirectRequest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 2
dl 0
loc 33
rs 10
c 1
b 0
f 0
ccs 0
cts 13
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
A rules() 0 10 1
1
<?php namespace Arcanesoft\Seo\Http\Requests\Admin\Redirects;
2
3
/**
4
 * Class     UpdateRedirectRequest
5
 *
6
 * @package  Arcanesoft\Seo\Http\Requests\Admin\Redirects
7
 * @author   ARCANEDEV <[email protected]>
8
 */
9
class UpdateRedirectRequest extends RedirectFormRequest
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
        $redirect = $this->route('seo_redirect');
34
35
        return [
36
            'old_url' => ['required', 'string', $this->getOldUrlRule()->ignore($redirect->id)],
37
            'new_url' => ['required', 'string'],
38
            'status'  => $this->getStatusRule(),
39
        ];
40
    }
41
}
42