davy_yg
3 months ago
33
11
Laravel

productRepository

Posted 3 months ago by davy_yg

Hello,

I came across this code:

$product = $this->productRepository->findWithoutFail($id);

if (empty($product)) {
           return $this->sendError('Product not found');
       }

$product = $this->productRepository->update($input, $id);

return $this->sendResponse($product->toArray(), 'Product updated successfully');

I wonder where does productRepository comes from?

Please sign in or create an account to participate in this conversation.