first commit
This commit is contained in:
34
Modules/Payroll/app/Repositories/PaymentRepository.php
Normal file
34
Modules/Payroll/app/Repositories/PaymentRepository.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user