| @@ -34,8 +34,9 @@ | ||
| 34 | 34 | use FluentCart\App\Http\Controllers\TaxRateController; |
| 35 | 35 | use FluentCart\App\Http\Controllers\TemplateController; |
| 36 | 36 | use FluentCart\App\Http\Controllers\VariantController; |
| 37 | 37 | use FluentCart\App\Http\Controllers\WidgetsController; |
| 38 | +use FluentCart\App\Http\Controllers\ProductReviewController; | |
| 38 | 39 | use FluentCart\App\Modules\PaymentMethods\PayPalGateway\ConnectConfig; |
| 39 | 40 | use FluentCart\Framework\Http\Router; |
| 40 | 41 | use \FluentCart\App\Http\Controllers\PaymentMethodController; |
| 41 | 42 | use \FluentCart\App\Http\Controllers\ActivityController; |
| @@ -976,5 +977,39 @@ | ||
| 976 | 977 | |
| 977 | 978 | $router->prefix('checkout-fields')->withPolicy('StoreSensitivePolicy')->group(function (Router $router) { |
| 978 | 979 | $router->get('get-fields', [CheckoutFieldsController::class, 'getFields']); |
| 979 | 980 | $router->post('save-fields', [CheckoutFieldsController::class, 'saveFields']); |
| 981 | +}); | |
| 982 | + | |
| 983 | +// Product Reviews routes | |
| 984 | +$router->prefix('reviews')->withPolicy('ReviewPolicy')->group(function (Router $router) { | |
| 985 | + $router->get('/', [ProductReviewController::class, 'index'])->meta([ | |
| 986 | + 'permissions' => 'reviews/manage' | |
| 987 | + ]); | |
| 988 | + $router->get('/stats', [ProductReviewController::class, 'stats'])->meta([ | |
| 989 | + 'permissions' => 'reviews/manage' | |
| 990 | + ]); | |
| 991 | + $router->get('/{id}', [ProductReviewController::class, 'find'])->int('id')->meta([ | |
| 992 | + 'permissions' => 'reviews/manage' | |
| 993 | + ]); | |
| 994 | + $router->put('/{id}', [ProductReviewController::class, 'update'])->int('id')->meta([ | |
| 995 | + 'permissions' => 'reviews/manage' | |
| 996 | + ]); | |
| 997 | + $router->delete('/{id}', [ProductReviewController::class, 'delete'])->int('id')->meta([ | |
| 998 | + 'permissions' => 'reviews/manage' | |
| 999 | + ]); | |
| 1000 | + $router->post('/bulk-action', [ProductReviewController::class, 'bulkAction'])->meta([ | |
| 1001 | + 'permissions' => 'reviews/manage' | |
| 1002 | + ]); | |
| 1003 | + $router->post('/{id}/reply', [ProductReviewController::class, 'reply'])->int('id')->meta([ | |
| 1004 | + 'permissions' => 'reviews/manage' | |
| 1005 | + ]); | |
| 1006 | + $router->delete('/{reviewId}/replies/{replyId}', [ProductReviewController::class, 'deleteReply'])->int('reviewId')->int('replyId')->meta([ | |
| 1007 | + 'permissions' => 'reviews/manage' | |
| 1008 | + ]); | |
| 1009 | + $router->post('/bulk-reply', [ProductReviewController::class, 'bulkReply'])->meta([ | |
| 1010 | + 'permissions' => 'reviews/manage' | |
| 1011 | + ]); | |
| 1012 | + $router->post('/', [ProductReviewController::class, 'create'])->meta([ | |
| 1013 | + 'permissions' => 'reviews/manage' | |
| 1014 | + ]); | |
| 980 | 1015 | }); |