related
This commit is contained in:
parent
c54d727245
commit
09faddcc48
|
|
@ -21,6 +21,7 @@ use Carbon\Carbon;
|
|||
use Webkul\CMS\Repositories\CmsRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Webkul\Product\Repositories\ProductRepository as ProductWebkulRep;
|
||||
|
||||
class Products extends ProductController
|
||||
{
|
||||
|
|
@ -75,7 +76,12 @@ class Products extends ProductController
|
|||
}
|
||||
}
|
||||
|
||||
public function home(SliderRepository $sliderRepository,)
|
||||
public function getCurrentProduct(ProductWebkulRep $prodRep, $id)
|
||||
{
|
||||
return ProductResource::collection($prodRep->getProductsRelatedToCategory($id));
|
||||
}
|
||||
|
||||
public function home(SliderRepository $sliderRepository)
|
||||
{
|
||||
// $data = [
|
||||
// "sliders" => $sliderRepository->getActiveSliders(),
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ Route::group(['prefix' => 'api'], function () {
|
|||
Route::get('products-search', [Products::class, 'searchProducts']);
|
||||
Route::get('suggestions', [\Sarga\API\Http\Controllers\SearchController::class, 'index']);
|
||||
Route::get('products/{id}', [Products::class, 'get']);
|
||||
Route::get('products/related/{id}', [Products::class, 'getCurrentProduct']);
|
||||
Route::get('products/{id}/variants', [Products::class, 'variants']);
|
||||
|
||||
Route::get('states', [ResourceController::class, 'index'])->defaults('_config', [
|
||||
|
|
|
|||
Loading…
Reference in New Issue