Heera/Modules/Billing/app/Repositories/BillingComponentRepository.php

40 lines
911 B
PHP
Raw Permalink Normal View History

2024-05-16 03:46:08 +00:00
<?php
namespace Modules\Billing\Repositories;
use Modules\Billing\Models\BillingComponent;
class BillingComponentRepository implements BillingComponentInterface
{
public function findAll()
{
return BillingComponent::get();
}
public function getBillingComponentById($billingComponentId)
{
return BillingComponent::findOrFail($billingComponentId);
}
public function delete($billingComponentId)
{
BillingComponent::destroy($billingComponentId);
}
public function create(array $billingComponentDetails)
{
return BillingComponent::create($billingComponentDetails);
}
public function update($billingComponentId, array $newDetails)
{
return BillingComponent::whereId($billingComponentId)->update($newDetails);
}
public function pluck()
{
return BillingComponent::pluck('title', 'id');
}
}