img search test

This commit is contained in:
Kerim 2023-04-17 02:03:06 +05:00
parent 69e2af5f18
commit 6cb2d5493a
3 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,7 @@ use Sarga\Shop\Repositories\AttributeOptionRepository;
use Webkul\Product\Repositories\ProductFlatRepository;
use Sarga\API\Http\Controllers\Banners as Slider;
use Webkul\Core\Repositories\SliderRepository;
use Webkul\Product\Repositories\SearchRepository;
use Carbon\Carbon;
class Products extends ProductController
@ -192,4 +193,9 @@ class Products extends ProductController
{
return ProductResource::collection($this->productRepository->getPopularProducts(request()->input('category')));
}
public function searchImg(SearchRepository $searchRepository)
{
return $searchRepository->uploadSearchImage(request()->all());
}
}

View File

@ -57,6 +57,7 @@ Route::group(['prefix' => 'api'], function () {
]);
Route::get('home', [Products::class, 'home']);
Route::post('search/image', [Products::class, 'searchImg']);
//Product routes
Route::get('products', [Products::class, 'index']);

View File

@ -49,7 +49,7 @@ Route::group(['middleware' => ['web', 'locale', 'theme', 'currency']], function
'view' => 'shop::search.search',
])->name('shop.search.index');
Route::post('/upload-search-image', [HomeController::class, 'upload'])->name('shop.image.search.upload');
Route::post('/upload-search-image', [HomeController::class, 'upload'])->name('');
/**
* Subscription routes.