StocksNew/Modules/Admin/app/Repositories/PromotionDemotionRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

36 lines
829 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\PromotionDemotion;
class PromotionDemotionRepository implements PromotionDemotionInterface
{
public function findAll()
{
return PromotionDemotion::get();
}
public function getPromotionDemotionById($promotionDemotionId)
{
return PromotionDemotion::findOrFail($promotionDemotionId);
}
public function delete($promotionDemotionId)
{
PromotionDemotion::destroy($promotionDemotionId);
}
public function create(array $promotionDemotionDetails)
{
return PromotionDemotion::create($promotionDemotionDetails);
}
public function update($promotionDemotionId, array $newDetails)
{
return PromotionDemotion::whereId($promotionDemotionId)->update($newDetails);
}
}