StudentRequest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 4 1
A messages() 0 3 1
A attributes() 0 3 1
A rules() 0 7 1
1
<?php
2
3
namespace App\Http\Requests;
4
5
use Illuminate\Foundation\Http\FormRequest;
6
7
class StudentRequest extends FormRequest
8
{
9
    /**
10
     * Determine if the user is authorized to make this request.
11
     *
12
     * @return bool
13
     */
14
    public function authorize()
15
    {
16
        // only allow updates if the user is logged in
17
        return backpack_auth()->check();
18
    }
19
20
    /**
21
     * Get the validation rules that apply to the request.
22
     *
23
     * @return array
24
     */
25
    public function rules()
26
    {
27
        return [
28
            'firstname' => 'required|max:255',
29
            'lastname' => 'required|max:255',
30
            'email' => 'nullable|email',
31
            'birthdate' => 'nullable|date',
32
        ];
33
    }
34
35
    /**
36
     * Get the validation attributes that apply to the request.
37
     *
38
     * @return array
39
     */
40
    public function attributes()
41
    {
42
        return [
43
            //
44
        ];
45
    }
46
47
    /**
48
     * Get the validation messages that apply to the request.
49
     *
50
     * @return array
51
     */
52
    public function messages()
53
    {
54
        return [
55
            //
56
        ];
57
    }
58
}
59