paginate(20); } public function getIngredientById($IngredientId) { return Ingredient::findOrFail($IngredientId); } public function getIngredientByEmail($email) { return Ingredient::where('email', $email)->first(); } public function getIngredientsByCategory($ingredientCategoryId) { return Ingredient::where('ingredient_category_id', $ingredientCategoryId)->pluck('name', 'id'); } public function delete($IngredientId) { Ingredient::destroy($IngredientId); } public function create($IngredientDetails) { return Ingredient::create($IngredientDetails); } public function update($IngredientId, array $newDetails) { return Ingredient::whereId($IngredientId)->update($newDetails); } public function pluck() { return Ingredient::pluck('name', 'id'); } }