PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.7
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.7
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Http / Controllers / SubmissionLogController.php

SubmissionLogController.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.2.7, at app/Http/Controllers/SubmissionLogController.php

59 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Http\Controllers;
4
5 use Exception;
6 use FluentForm\App\Services\Logger\Logger;
7
8 class SubmissionLogController extends Controller
9 {
10 public function get(Logger $logger, $submissionId)
11 {
12 try {
13 $attributes = $this->request->all();
14
15 $sanitizeMap = [
16 'page' => 'intval',
17 'per_page' => 'intval',
18 ];
19 $attributes = fluentform_backend_sanitizer($attributes, $sanitizeMap);
20
21 return $this->sendSuccess(
22 $logger->getSubmissionLogs($submissionId, $attributes)
23 );
24 } catch (Exception $e) {
25 return $this->sendError([
26 'message' => $e->getMessage(),
27 ]);
28 }
29 }
30
31 public function remove(Logger $logger, $submissionId)
32 {
33 try {
34 $attributes = $this->request->all();
35
36 $sanitizeMap = [
37 'log_ids' => function ($value) {
38 if (is_array($value)) {
39 return array_map('intval', $value);
40 }
41
42 return [];
43 },
44 'type' => 'sanitize_text_field',
45 ];
46 $attributes = fluentform_backend_sanitizer($attributes, $sanitizeMap);
47 $attributes['entry_id'] = intval($submissionId);
48
49 return $this->sendSuccess(
50 $logger->remove($attributes)
51 );
52 } catch (Exception $e) {
53 return $this->sendError([
54 'message' => $e->getMessage(),
55 ]);
56 }
57 }
58 }
59