PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / trunk
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler vtrunk
1.6.6 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 All 49 releases
fluent-cart / app / Http / Requests / TaxRateRequest.php

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

47 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\Framework\Foundation\RequestGuard;
6
7 class TaxRateRequest extends RequestGuard
8 {
9
10 public function rules()
11 {
12 return [
13 'country' => 'nullable|sanitizeText|maxLength:45',
14 'state' => 'nullable|sanitizeText|maxLength:45',
15 'postcode' => 'nullable|sanitizeText|maxLength:45',
16 'city' => 'nullable|sanitizeText|maxLength:45',
17 'rate' => 'nullable|numeric|min:0|max:99999',
18 'name' => 'nullable|sanitizeText|maxLength:45',
19 'group' => 'nullable|sanitizeText|maxLength:45',
20 'priority' => 'nullable|numeric|min:1',
21 'is_compound' => 'nullable|numeric|min:0',
22 'for_shipping' => 'nullable|numeric|min:0',
23 'for_order' => 'nullable|numeric|min:0',
24 'class_id' => 'nullable|numeric|min:1',
25 ];
26 }
27
28 public function sanitize()
29 {
30 return [
31 'country' => 'sanitize_text_field',
32 'state' => 'sanitize_text_field',
33 'postcode' => 'sanitize_text_field',
34 'city' => 'sanitize_text_field',
35 'rate' => 'floatval',
36 'name' => 'sanitize_text_field',
37 'group' => 'sanitize_text_field',
38 'priority' => 'intval',
39 'is_compound' => 'intval',
40 'for_shipping' => 'floatval',
41 'for_order' => 'intval',
42 'class_id' => 'intval',
43 ];
44 }
45
46 }
47