product_repo = $product_repo; } /** */ public function index(ProductFilters $filters) { $products = Product::filter($filters); return $this->listResponse($products); } /** * Show the form for creating a new resource. * * @return \Illuminate\Http\Response */ public function create(CreateProductRequest $request) { $product = ProductFactory::create(auth()->user()->company()->id, auth()->user()->id); return $this->itemResponse($product); } /** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function store(StoreProductRequest $request) { $product = $this->product_repo->save($request, ProductFactory::create(auth()->user()->company()->id, auth()->user()->id)); return $this->itemResponse($product); } /** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(ShowProductRequest $request, Product $product) { return $this->itemResponse($product); } /** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit(EditProductRequest $request, Product $product) { return $this->itemResponse($product); } /** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(UpdateProductRequest $request, Product $product) { $product = $this->product_repo->save($request, $product); return $this->itemResponse($product); } /** * Remove the specified resource from storage. * * @param int $id * @return \Illuminate\Http\Response */ public function destroy($id) { // } }