Completed
Push — master ( 8927df...f70445 )
by Abdelrahman
02:05
created

RoleUpdateRequest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 25
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
A rules() 0 7 1
1
<?php
2
3
/*
4
 * NOTICE OF LICENSE
5
 *
6
 * Part of the Rinvex Fort Package.
7
 *
8
 * This source file is subject to The MIT License (MIT)
9
 * that is bundled with this package in the LICENSE file.
10
 *
11
 * Package: Rinvex Fort Package
12
 * License: The MIT License (MIT)
13
 * Link:    https://rinvex.com
14
 */
15
16
namespace Rinvex\Fort\Http\Requests\Backend;
17
18
use Rinvex\Support\Http\Requests\FormRequest;
19
20
class RoleUpdateRequest extends FormRequest
21
{
22
    /**
23
     * Determine if the user is authorized to make this request.
24
     *
25
     * @return bool
26
     */
27
    public function authorize()
28
    {
29
        return true;
30
    }
31
32
    /**
33
     * Get the validation rules that apply to the request.
34
     *
35
     * @return array
0 ignored issues
show
Documentation introduced by
Consider making the return type a bit more specific; maybe use array<string,string>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
36
     */
37
    public function rules()
38
    {
39
        return [
40
            'slug'  => 'required|unique:'.config('rinvex.fort.tables.roles').',slug,'.$this->get('id'),
41
            'title' => 'required',
42
        ];
43
    }
44
}
45