35 lines
666 B
PHP
35 lines
666 B
PHP
|
<?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);
|
||
|
}
|
||
|
}
|