search suggestions finish
This commit is contained in:
parent
e60b12af16
commit
cb2550935e
|
|
@ -168,4 +168,8 @@ class Products extends ProductController
|
|||
|
||||
}
|
||||
|
||||
public function search(){
|
||||
return ProductResource::collection($this->productRepository->searchProductByAttribute(request('key')));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ Route::group(['prefix' => 'api'], function () {
|
|||
|
||||
//Product routes
|
||||
Route::get('products', [Products::class, 'index']);
|
||||
Route::get('products/search', [Products::class, 'search']);
|
||||
Route::get('suggestions', [Products::class, 'suggestions']);
|
||||
Route::get('products/{id}', [Products::class, 'get']);
|
||||
Route::get('products/{id}/variants', [Products::class, 'variants']);
|
||||
|
|
|
|||
Loading…
Reference in New Issue