File tree 2 files changed +10
-7
lines changed
QueryFilter/Queries/Eloquent
2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 10
10
*/
11
11
class WhereCustom extends BaseClause
12
12
{
13
- /**
14
- *
15
- */
16
- public const METHOD_SIGN = "filterCustom " ;
17
-
18
13
/**
19
14
* @param $query
20
15
*
@@ -32,8 +27,10 @@ public function apply($query)
32
27
*/
33
28
public static function getMethod ($ filter ): string
34
29
{
30
+ $ custom_method_sign = config ('eloquentFilter.custom_method_sign ' );
31
+
35
32
$ filter = ucfirst ($ filter );
36
- $ method = self :: METHOD_SIGN . $ filter ;
33
+ $ method = $ custom_method_sign . $ filter ;
37
34
return $ method ;
38
35
}
39
36
}
Original file line number Diff line number Diff line change 48
48
'request_salt ' => function () {
49
49
return 1234 ;
50
50
},
51
+
51
52
/*
52
53
* Cast sign method is prefix name method for change data before filtering.
53
54
*/
54
- 'cast_method_sign ' => 'filterSet '
55
+ 'cast_method_sign ' => 'filterSet ' ,
56
+
57
+ /*
58
+ * custom sign method is prefix name method for custom methods in models.
59
+ */
60
+ 'custom_method_sign ' => 'filterCustom '
55
61
];
You can’t perform that action at this time.
0 commit comments