PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.3.27
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.3.27
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
fluent-cart / app / Http / Requests / TaxRateRequest.php

TaxRateRequest.php in FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler 1.3.27, at app/Http/Requests/TaxRateRequest.php

49 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentCart\App\Http\Requests;
4
5 use FluentCart\App\Models\TaxClass;
6 use FluentCart\Framework\Foundation\RequestGuard;
7 use FluentCart\Framework\Support\Arr;
8
9 class TaxRateRequest extends RequestGuard
10 {
11
12 public function rules()
13 {
14 return [
15 'country' => 'nullable|sanitizeText|maxLength:45',
16 'state' => 'nullable|sanitizeText|maxLength:45',
17 'postcode' => 'nullable|sanitizeText|maxLength:45',
18 'city' => 'nullable|sanitizeText|maxLength:45',
19 'rate' => 'nullable|sanitizeText|maxLength:45',
20 'name' => 'nullable|sanitizeText|maxLength:45',
21 'group' => 'nullable|sanitizeText|maxLength:45',
22 'priority' => 'nullable|numeric|min:1',
23 'is_compound' => 'nullable|numeric|min:0',
24 'for_shipping' => 'nullable|numeric|min:0',
25 'for_order' => 'nullable|numeric|min:0',
26 'class_id' => 'required|min:0',
27 ];
28 }
29
30 public function sanitize()
31 {
32 return [
33 'country' => 'sanitize_text_field',
34 'state' => 'sanitize_text_field',
35 'postcode' => 'sanitize_text_field',
36 'city' => 'sanitize_text_field',
37 'rate' => 'sanitize_text_field',
38 'name' => 'sanitize_text_field',
39 'group' => 'sanitize_text_field',
40 'priority' => 'intval',
41 'is_compound' => 'intval',
42 'for_shipping' => 'intval',
43 'for_order' => 'intval',
44 'class_id' => 'intval',
45 ];
46 }
47
48 }
49