PluginProbe
ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema / trunk
ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema vtrunk
2.5.1 2.5.0 2.4.1 2.4.0 2.3.11 2.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 All 143 releases
reviewx / app / Rest / Controllers / DashboardController.php

DashboardController.php in ReviewX – Multi-Criteria Reviews for WooCommerce with Google Reviews & Schema trunk, at app/Rest/Controllers/DashboardController.php

76 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ReviewX\Rest\Controllers;
4
5 \defined("ABSPATH") || exit;
6 use ReviewX\Services\DashboardServices;
7 use ReviewX\Utilities\Helper;
8 use Throwable;
9 use ReviewX\WPDrill\Contracts\InvokableContract;
10 use ReviewX\WPDrill\Response;
11 class DashboardController implements InvokableContract
12 {
13 protected $dashboardServices;
14 /**
15 *
16 */
17 public function __construct(DashboardServices $dashboardServices)
18 {
19 $this->dashboardServices = $dashboardServices;
20 }
21 /**
22 * @return void
23 */
24 public function __invoke()
25 {
26 }
27 /**
28 * @return Response
29 */
30 public function insight()
31 {
32 $resp = $this->dashboardServices->insight();
33 return Helper::getApiResponse($resp);
34 }
35 /**
36 * @return Response
37 */
38 public function requestEmail()
39 {
40 $resp = $this->dashboardServices->requestEmail();
41 return Helper::getApiResponse($resp);
42 }
43 /**
44 * Orders list (with review-request status) for the Review Reminder "Orders" tab.
45 *
46 * @param $request
47 * @return Response
48 */
49 public function orders($request)
50 {
51 $resp = $this->dashboardServices->orders($request->get_params());
52 return Helper::getApiResponse($resp);
53 }
54 /**
55 * @return \WPDrill\Response
56 */
57 public function requestUserData()
58 {
59 try {
60 $response = $this->dashboardServices->requestUserData();
61 return Helper::rvxApi($response)->success('Site data Retrieved Successfully');
62 } catch (Throwable $e) {
63 return Helper::rvxApi(['error' => $e->getMessage()])->fails('Site data Retrieval Failed', $e->getCode());
64 }
65 }
66 /**
67 * @param $request
68 * @return Response
69 */
70 public function chart($request)
71 {
72 $resp = $this->dashboardServices->chart($request->get_params());
73 return Helper::getApiResponse($resp);
74 }
75 }
76