1 | <?php |
||
2 | /* |
||
3 | |-------------------------------------------------------------------------- |
||
4 | | Prettus Repository Config |
||
5 | |-------------------------------------------------------------------------- |
||
6 | | |
||
7 | | |
||
8 | */ |
||
9 | |||
10 | return [ |
||
11 | |||
12 | /* |
||
13 | |-------------------------------------------------------------------------- |
||
14 | | Repository Pagination Limit Default |
||
15 | |-------------------------------------------------------------------------- |
||
16 | | |
||
17 | */ |
||
18 | 'pagination' => [ |
||
19 | 'limit' => 15, |
||
20 | ], |
||
21 | |||
22 | /* |
||
23 | |-------------------------------------------------------------------------- |
||
24 | | Fractal Presenter Config |
||
25 | |-------------------------------------------------------------------------- |
||
26 | | |
||
27 | |||
28 | Available serializers: |
||
29 | ArraySerializer |
||
30 | DataArraySerializer |
||
31 | JsonApiSerializer |
||
32 | |||
33 | */ |
||
34 | 'fractal' => [ |
||
35 | 'params' => [ |
||
36 | 'include' => 'include', |
||
37 | ], |
||
38 | 'serializer' => Modules\Core\Supports\ResultSerializer::class, |
||
39 | ], |
||
40 | |||
41 | /* |
||
42 | |-------------------------------------------------------------------------- |
||
43 | | Cache Config |
||
44 | |-------------------------------------------------------------------------- |
||
45 | | |
||
46 | */ |
||
47 | 'cache' => [ |
||
48 | /* |
||
49 | |-------------------------------------------------------------------------- |
||
50 | | Cache Status |
||
51 | |-------------------------------------------------------------------------- |
||
52 | | |
||
53 | | Enable or disable cache |
||
54 | | |
||
55 | */ |
||
56 | 'enabled' => false, |
||
57 | |||
58 | /* |
||
59 | |-------------------------------------------------------------------------- |
||
60 | | Cache Minutes |
||
61 | |-------------------------------------------------------------------------- |
||
62 | | |
||
63 | | Time of expiration cache |
||
64 | | |
||
65 | */ |
||
66 | 'minutes' => 30, |
||
67 | |||
68 | /* |
||
69 | |-------------------------------------------------------------------------- |
||
70 | | Cache Repository |
||
71 | |-------------------------------------------------------------------------- |
||
72 | | |
||
73 | | Instance of Illuminate\Contracts\Cache\Repository |
||
74 | | |
||
75 | */ |
||
76 | 'repository' => 'cache', |
||
77 | |||
78 | /* |
||
79 | |-------------------------------------------------------------------------- |
||
80 | | Cache Clean Listener |
||
81 | |-------------------------------------------------------------------------- |
||
82 | | |
||
83 | | |
||
84 | | |
||
85 | */ |
||
86 | 'clean' => [ |
||
87 | |||
88 | /* |
||
89 | |-------------------------------------------------------------------------- |
||
90 | | Enable clear cache on repository changes |
||
91 | |-------------------------------------------------------------------------- |
||
92 | | |
||
93 | */ |
||
94 | 'enabled' => true, |
||
95 | |||
96 | /* |
||
97 | |-------------------------------------------------------------------------- |
||
98 | | Actions in Repository |
||
99 | |-------------------------------------------------------------------------- |
||
100 | | |
||
101 | | create : Clear Cache on create Entry in repository |
||
102 | | update : Clear Cache on update Entry in repository |
||
103 | | delete : Clear Cache on delete Entry in repository |
||
104 | | |
||
105 | */ |
||
106 | 'on' => [ |
||
107 | 'create' => true, |
||
108 | 'update' => true, |
||
109 | 'delete' => true, |
||
110 | ], |
||
111 | ], |
||
112 | |||
113 | 'params' => [ |
||
114 | /* |
||
115 | |-------------------------------------------------------------------------- |
||
116 | | Skip Cache Params |
||
117 | |-------------------------------------------------------------------------- |
||
118 | | |
||
119 | | |
||
120 | | Ex: http://prettus.local/?search=lorem&skipCache=true |
||
121 | | |
||
122 | */ |
||
123 | 'skipCache' => 'skipCache', |
||
124 | ], |
||
125 | |||
126 | /* |
||
127 | |-------------------------------------------------------------------------- |
||
128 | | Methods Allowed |
||
129 | |-------------------------------------------------------------------------- |
||
130 | | |
||
131 | | methods cacheable : all, paginate, find, findByField, findWhere, getByCriteria |
||
132 | | |
||
133 | | Ex: |
||
134 | | |
||
135 | | 'only' =>['all','paginate'], |
||
136 | | |
||
137 | | or |
||
138 | | |
||
139 | | 'except' =>['find'], |
||
140 | */ |
||
141 | 'allowed' => [ |
||
142 | 'only' => null, |
||
143 | 'except' => null, |
||
144 | ], |
||
145 | ], |
||
146 | |||
147 | /* |
||
148 | |-------------------------------------------------------------------------- |
||
149 | | Criteria Config |
||
150 | |-------------------------------------------------------------------------- |
||
151 | | |
||
152 | | Settings of request parameters names that will be used by Criteria |
||
153 | | |
||
154 | */ |
||
155 | 'criteria' => [ |
||
156 | /* |
||
157 | |-------------------------------------------------------------------------- |
||
158 | | Accepted Conditions |
||
159 | |-------------------------------------------------------------------------- |
||
160 | | |
||
161 | | Conditions accepted in consultations where the Criteria |
||
162 | | |
||
163 | | Ex: |
||
164 | | |
||
165 | | 'acceptedConditions'=>['=','like'] |
||
166 | | |
||
167 | | $query->where('foo','=','bar') |
||
168 | | $query->where('foo','like','bar') |
||
169 | | |
||
170 | */ |
||
171 | 'acceptedConditions' => [ |
||
172 | '=', |
||
173 | 'like', |
||
174 | '>', |
||
175 | '>=', |
||
176 | '<', |
||
177 | '<=', |
||
178 | '<>', |
||
179 | 'in', |
||
180 | 'between', |
||
181 | 'cross', |
||
182 | ], |
||
183 | /* |
||
184 | |-------------------------------------------------------------------------- |
||
185 | | Request Params |
||
186 | |-------------------------------------------------------------------------- |
||
187 | | |
||
188 | | Request parameters that will be used to filter the query in the repository |
||
189 | | |
||
190 | | Params : |
||
191 | | |
||
192 | | - search : Searched value |
||
193 | | Ex: http://prettus.local/?search=lorem |
||
194 | | |
||
195 | | - searchFields : Fields in which research should be carried out |
||
196 | | Ex: |
||
197 | | http://prettus.local/?search=lorem&searchFields=name;email |
||
198 | | http://prettus.local/?search=lorem&searchFields=name:like;email |
||
199 | | http://prettus.local/?search=lorem&searchFields=name:like |
||
200 | | |
||
201 | | - filter : Fields that must be returned to the response object |
||
202 | | Ex: |
||
203 | | http://prettus.local/?search=lorem&filter=id,name |
||
204 | | |
||
205 | | - orderBy : Order By |
||
206 | | Ex: |
||
207 | | http://prettus.local/?search=lorem&orderBy=id |
||
208 | | |
||
209 | | - sortedBy : Sort |
||
210 | | Ex: |
||
211 | | http://prettus.local/?search=lorem&orderBy=id&sortedBy=asc |
||
212 | | http://prettus.local/?search=lorem&orderBy=id&sortedBy=desc |
||
213 | | |
||
214 | | - searchJoin: Specifies the search method (AND / OR), by default the |
||
215 | | application searches each parameter with OR |
||
216 | | EX: |
||
217 | | http://prettus.local/?search=lorem&searchJoin=and |
||
218 | | http://prettus.local/?search=lorem&searchJoin=or |
||
219 | | |
||
220 | */ |
||
221 | 'params' => [ |
||
222 | 'search' => 'search', |
||
223 | 'searchFields' => 'searchFields', |
||
224 | 'filter' => 'filter', |
||
225 | 'orderBy' => 'orderBy', |
||
226 | 'sortedBy' => 'sortedBy', |
||
227 | 'with' => 'with', |
||
228 | 'searchJoin' => 'searchJoin', |
||
229 | ], |
||
230 | ], |
||
231 | /* |
||
232 | |-------------------------------------------------------------------------- |
||
233 | | Generator Config |
||
234 | |-------------------------------------------------------------------------- |
||
235 | | |
||
236 | */ |
||
237 | 'generator' => [ |
||
238 | 'basePath' => app()->path(), |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
239 | 'rootNamespace' => 'App\\', |
||
240 | 'stubsOverridePath' => app()->path(), |
||
241 | 'paths' => [ |
||
242 | 'models' => 'Entities', |
||
243 | 'repositories' => 'Repositories', |
||
244 | 'interfaces' => 'Repositories', |
||
245 | 'transformers' => 'Transformers', |
||
246 | 'presenters' => 'Presenters', |
||
247 | 'validators' => 'Validators', |
||
248 | 'controllers' => 'Http/Controllers', |
||
249 | 'provider' => 'RepositoryServiceProvider', |
||
250 | 'criteria' => 'Criteria', |
||
251 | ], |
||
252 | ], |
||
253 | ]; |
||
254 |