Completed
Push — master ( 0b0069...b84639 )
by Mahmoud
03:38
created

SetUserEmailRequest::all()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 7
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 7
loc 7
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace App\Containers\Email\UI\API\Requests;
4
5
use App\Port\Request\Abstracts\Request;
6
7
/**
8
 * Class SetUserEmailRequest.
9
 *
10
 * @author Mahmoud Zalt <[email protected]>
11
 */
12
class SetUserEmailRequest extends Request
13
{
14
15
    /**
16
     * Get the validation rules that apply to the request.
17
     *
18
     * @return array
19
     */
20
    public function rules()
21
    {
22
        return [
23
            'email' => 'required|email|max:40',
24
        ];
25
    }
26
27
    /**
28
     * Determine if the user is authorized to make this request.
29
     *
30
     * @return bool
31
     */
32
    public function authorize()
33
    {
34
        // TODO: add policy checking if the user is authorized to set his own Email
35
36
        return true;
37
    }
38
}
39