Completed
Push — develop ( 554465...735a56 )
by Abdelrahman
02:03
created

RegistrationRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 28
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A authorize() 0 8 2
A rules() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Fort\Http\Requests\Frontend;
6
7
use Rinvex\Support\Http\Requests\FormRequest;
8
use Cortex\Foundation\Exceptions\GenericException;
9
10
class RegistrationRequest extends FormRequest
11
{
12
    /**
13
     * Determine if the user is authorized to make this request.
14
     *
15
     * @throws \Cortex\Foundation\Exceptions\GenericException
16
     *
17
     * @return bool
18
     */
19
    public function authorize()
20
    {
21
        if (! config('rinvex.fort.registration.enabled')) {
22
            throw new GenericException(trans('cortex/fort::messages.register.disabled'));
23
        }
24
25
        return true;
26
    }
27
28
    /**
29
     * Get the validation rules that apply to the request.
30
     *
31
     * @return array
32
     */
33
    public function rules()
34
    {
35
        return [];
36
    }
37
}
38