| @@ -9,8 +9,9 @@ | ||
| 9 | 9 | use FluentCart\App\Http\Controllers\FrontendControllers\CustomerController; |
| 10 | 10 | use FluentCart\App\Http\Controllers\FrontendControllers\CustomerOrderController; |
| 11 | 11 | use FluentCart\App\Http\Controllers\FrontendControllers\CustomerProfileController; |
| 12 | 12 | use FluentCart\App\Http\Controllers\FrontendControllers\CustomerSubscriptionController; |
| 13 | +use FluentCart\App\Http\Controllers\FrontendControllers\ProductReviewFrontendController; | |
| 13 | 14 | use FluentCart\App\Http\Controllers\ShopController; |
| 14 | 15 | use FluentCart\App\Http\Controllers\UserController; |
| 15 | 16 | use FluentCart\App\Modules\Shipping\Http\Controllers\Frontend\ShippingFrontendController; |
| 16 | 17 | use FluentCart\Framework\Http\Router; |
| @@ -96,5 +97,19 @@ | ||
| 96 | 97 | $router->post('subscriptions/{subscription_uuid}/initiate-early-payment', [CustomerSubscriptionController::class, 'initiateEarlyPayment'])->alphaNumDash('subscription_uuid'); |
| 97 | 98 | $router->post('subscriptions/{subscription_uuid}/pause', [CustomerSubscriptionController::class, 'pauseSubscription'])->alphaNumDash('subscription_uuid'); |
| 98 | 99 | $router->post('subscriptions/{subscription_uuid}/resume', [CustomerSubscriptionController::class, 'resumeSubscription'])->alphaNumDash('subscription_uuid'); |
| 99 | 100 | |
| 101 | + // my reviews — type=pending returns the to-be-reviewed products | |
| 102 | + $router->get('reviews', [ProductReviewFrontendController::class, 'getReviewsByCustomer']); | |
| 103 | + $router->get('reviews/submission-form', [ProductReviewFrontendController::class, 'getReviewSubmissionForm']); | |
| 100 | 104 | }); |
| 105 | + | |
| 106 | +// Public product reviews routes | |
| 107 | +$router->prefix('public/reviews') | |
| 108 | + ->withPolicy('PublicPolicy')->group(function (Router $router) { | |
| 109 | + $router->get('/{postId}', [ProductReviewFrontendController::class, 'getReviews'])->int('postId'); | |
| 110 | + $router->get('/{postId}/summary', [ProductReviewFrontendController::class, 'getRatingSummary'])->int('postId'); | |
| 111 | + $router->post('/{postId}', [ProductReviewFrontendController::class, 'submitReview'])->int('postId'); | |
| 112 | + $router->put('/{postId}/{reviewId}', [ProductReviewFrontendController::class, 'updateReview'])->int('postId')->int('reviewId'); | |
| 113 | + $router->get('/{postId}/{reviewId}/replies', [ProductReviewFrontendController::class, 'getReplies'])->int('postId')->int('reviewId'); | |
| 114 | + $router->get('/{postId}/{reviewId}/modal', [ProductReviewFrontendController::class, 'getModalView'])->int('postId')->int('reviewId'); | |
| 115 | + }); | |