PromotionRequest::rules()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Gamer\Http\Requests;
4
5
use Auth;
6
use Gate;
7
use Siravel\Models\Negocios\Promotion;
8
use Illuminate\Foundation\Http\FormRequest;
9
10
class PromotionRequest extends FormRequest
11
{
12
    /**
13
     * Determine if the user is authorized to make this request.
14
     *
15
     * @return bool
16
     */
17
    public function authorize()
18
    {
19
        if (\Illuminate\Support\Facades\Config::get('app.env') !== 'testing') {
20
            return Gate::allows('cms', Auth::user());
21
        }
22
23
        return true;
24
    }
25
26
    /**
27
     * Get the validation rules that apply to the request.
28
     *
29
     * @return array
30
     */
31
    public function rules()
32
    {
33
        return Promotion::$rules;
34
    }
35
}
36