@@ 10-35 (lines=26) @@ | ||
7 | use Population\Models\Calendar\Event; |
|
8 | use Illuminate\Foundation\Http\FormRequest; |
|
9 | ||
10 | class EventRequest 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 app(Event::class)->rules; |
|
34 | } |
|
35 | } |
|
36 |
@@ 10-35 (lines=26) @@ | ||
7 | use Siravel\Models\Negocios\Page; |
|
8 | use Illuminate\Foundation\Http\FormRequest; |
|
9 | ||
10 | class PagesRequest 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 app(Page::class)->rules; |
|
34 | } |
|
35 | } |
|
36 |
@@ 10-35 (lines=26) @@ | ||
7 | use Population\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 app(Promotion::class)->rules; |
|
34 | } |
|
35 | } |
|
36 |