| 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 |
|