Heera/Modules/Billing/app/Repositories/BillingComponentRepository.php
2024-05-16 09:31:08 +05:45

40 lines
911 B
PHP

<?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');
}
}