PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.4.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.4.1
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 / AttrTermRequest.php

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

53 lines 1.1 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 AttrTermRequest extends RequestGuard
8 {
9
10 /**
11 * @return array
12 */
13 public function rules()
14 {
15 $termId = $this->get('term_id');
16 $tbl = 'fct_atts_terms';
17
18 return [
19 'title' => 'required|sanitizeText|maxLength:50',
20 'slug' => 'required|sanitizeText|maxLength:50|unique:' . $tbl . ',slug,'.$termId.',id',
21 'description' => 'nullable|sanitizeTextArea',
22 'serial' => 'nullable|numeric'
23 ];
24 }
25
26
27 /**
28 * @return array
29 */
30 public function messages()
31 {
32 return [
33 'title.required' => esc_html__('Title is required', 'fluent-cart'),
34 'slug.required' => esc_html__('Slug is required', 'fluent-cart'),
35
36 ];
37 }
38
39
40 /**
41 * @return array
42 */
43 public function sanitize()
44 {
45 return [
46 'title' => 'sanitize_text_field',
47 'serial' => 'sanitize_text_field',
48 'description' => 'sanitize_text_field',
49 'slug' => 'sanitize_text_field'
50 ];
51 }
52 }
53