StocksNew/Modules/Payroll/app/Repositories/PaymentRepository.php

35 lines
666 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Payroll\Repositories;
use Modules\Payroll\Models\Payment;
class PaymentRepository implements PaymentInterface
{
public function findAll()
{
return Payment::get();
}
public function getPaymentById($paymentId)
{
return Payment::findOrFail($paymentId);
}
public function delete($paymentId)
{
Payment::destroy($paymentId);
}
public function create(array $paymentDetails)
{
return Payment::create($paymentDetails);
}
public function update($paymentId, array $newDetails)
{
return Payment::where('id', $paymentId)->update($newDetails);
}
}