salesentry filters
This commit is contained in:
@ -7,6 +7,7 @@ interface ProductInterface
|
||||
public function findAll();
|
||||
public function getProductById($ProductId);
|
||||
public function getProductByEmail($email);
|
||||
public function getProductsByCategory($categoryId);
|
||||
public function delete($ProductId);
|
||||
public function create($ProductDetails);
|
||||
public function update($ProductId, array $newDetails);
|
||||
|
@ -23,6 +23,11 @@ class ProductRepository implements ProductInterface
|
||||
return Product::where('email', $email)->first();
|
||||
}
|
||||
|
||||
public function getProductsByCategory($categoryId)
|
||||
{
|
||||
return Product::where('category_id', $categoryId)->pluck('name', 'id');
|
||||
}
|
||||
|
||||
public function delete($ProductId)
|
||||
{
|
||||
Product::destroy($ProductId);
|
||||
|
Reference in New Issue
Block a user