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

RegistrationRequest::authorize()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
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