Add product view tracking and related functionality
- Implemented product view tracking in ProductController to log user views. - Added a relationship for viewed products in the User model. - Introduced a method in ProductRepository to filter products viewed by a user. - Updated API routes to include endpoint for retrieving viewed products. - Commented out SMS notification logic in SendOrderCreatedNotification. - Removed CreateOrderServiceTest as it is no longer needed.
This commit is contained in:
1 parent
dee6b0df56
commit
968c9ed42a
11 files changed
+319
-86
No files matched your search
@@ -21,6 +21,7 @@
|
||||
use App\Http\Controllers\Api\V1\Product\ProductRelatedController;
|
||||
use App\Http\Controllers\Api\V1\Product\ProductReviewController;
|
||||
use App\Http\Controllers\Api\V1\Product\Search\ProductSearchController;
|
||||
use App\Http\Controllers\Api\V1\Product\ViewedProductController;
|
||||
use App\Http\Controllers\Api\V1\Profile\ProfileController;
|
||||
use App\Http\Controllers\Api\V1\Province\ProvinceController;
|
||||
use App\Http\Controllers\Api\V1\ReviewController;
|
||||
@@ -115,6 +116,9 @@
|
||||
Route::get('favorites', [FavoriteController::class, 'index']);
|
||||
Route::post('favorites', [FavoriteController::class, 'store']);
|
||||
|
||||
// Viewed products...
|
||||
Route::get('products/viewed', [ViewedProductController::class, 'index']);
|
||||
|
||||
// Reviews...
|
||||
Route::get('reviews', [ReviewController::class, 'index']);
|
||||
Route::patch('reviews/{review}', [ReviewController::class, 'update'])->where(['review' => '[0-9]+']);
|
||||
|
||||
Reference in new issue
Block a user