1 | <?php |
||
12 | abstract class DataTablesEditor |
||
13 | { |
||
14 | use ValidatesRequests; |
||
15 | |||
16 | /** |
||
17 | * Allowed dataTables editor actions. |
||
18 | * |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $actions = ['create', 'edit', 'remove']; |
||
22 | |||
23 | /** |
||
24 | * @var \Illuminate\Database\Eloquent\Model |
||
25 | */ |
||
26 | protected $model = null; |
||
27 | |||
28 | /** |
||
29 | * Process dataTables editor action request. |
||
30 | * |
||
31 | * @param Request $request |
||
32 | * @return JsonResponse|mixed |
||
33 | * @throws DataTablesEditorException |
||
34 | */ |
||
35 | public function process(Request $request) |
||
45 | |||
46 | /** |
||
47 | * Process create action request. |
||
48 | * |
||
49 | * @param Request $request |
||
50 | * @return JsonResponse |
||
51 | */ |
||
52 | public function create(Request $request) |
||
92 | |||
93 | /** |
||
94 | * Resolve model to used. |
||
95 | * |
||
96 | * @return Model |
||
97 | */ |
||
98 | protected function resolveModel() |
||
106 | |||
107 | /** |
||
108 | * Get create action validation rules. |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | abstract public function createRules(); |
||
113 | |||
114 | /** |
||
115 | * @param Validator $validator |
||
116 | * @return array |
||
117 | */ |
||
118 | protected function formatErrors(Validator $validator) |
||
131 | |||
132 | /** |
||
133 | * Display success data in dataTables editor format. |
||
134 | * |
||
135 | * @param array $data |
||
136 | * @param array $errors |
||
137 | * @return JsonResponse |
||
138 | */ |
||
139 | protected function toJson(array $data, array $errors = []) |
||
148 | |||
149 | /** |
||
150 | * Process edit action request. |
||
151 | * |
||
152 | * @param Request $request |
||
153 | * @return JsonResponse |
||
154 | */ |
||
155 | public function edit(Request $request) |
||
196 | |||
197 | /** |
||
198 | * Get edit action validation rules. |
||
199 | * |
||
200 | * @param Model $model |
||
201 | * @return array |
||
202 | */ |
||
203 | abstract public function editRules(Model $model); |
||
204 | |||
205 | /** |
||
206 | * Process remove action request. |
||
207 | * |
||
208 | * @param Request $request |
||
209 | * @return JsonResponse |
||
210 | */ |
||
211 | public function remove(Request $request) |
||
261 | |||
262 | /** |
||
263 | * Get remove action validation rules. |
||
264 | * |
||
265 | * @param Model $model |
||
266 | * @return array |
||
267 | */ |
||
268 | abstract public function removeRules(Model $model); |
||
269 | |||
270 | /** |
||
271 | * Get remove query exception message. |
||
272 | * |
||
273 | * @param QueryException $exception |
||
274 | * @param Model $model |
||
275 | * @return string |
||
276 | */ |
||
277 | protected function removeExceptionMessage(QueryException $exception, Model $model) |
||
281 | |||
282 | /** |
||
283 | * Display dataTables editor validation errors. |
||
284 | * |
||
285 | * @param Validator $validator |
||
286 | * @return JsonResponse |
||
287 | */ |
||
288 | protected function displayValidationErrors(Validator $validator) |
||
297 | } |
||
298 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.