47 lines
985 B
PHP
47 lines
985 B
PHP
<?php
|
|
|
|
namespace Modules\Order\Repositories;
|
|
|
|
use Modules\Order\Models\PaymentMode;
|
|
|
|
class PaymentModeRepository implements PaymentModeInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return PaymentMode::when(true, function ($query) {
|
|
|
|
})->paginate(20);
|
|
}
|
|
|
|
public function getPaymentModeById($PaymentModeId)
|
|
{
|
|
return PaymentMode::findOrFail($PaymentModeId);
|
|
}
|
|
|
|
public function getPaymentModeByEmail($email)
|
|
{
|
|
return PaymentMode::where('email', $email)->first();
|
|
}
|
|
|
|
public function delete($PaymentModeId)
|
|
{
|
|
PaymentMode::destroy($PaymentModeId);
|
|
}
|
|
|
|
public function create($PaymentModeDetails)
|
|
{
|
|
return PaymentMode::create($PaymentModeDetails);
|
|
}
|
|
|
|
public function update($PaymentModeId, array $newDetails)
|
|
{
|
|
return PaymentMode::whereId($PaymentModeId)->update($newDetails);
|
|
}
|
|
|
|
public function pluck()
|
|
{
|
|
return PaymentMode::pluck('name', 'id');
|
|
}
|
|
|
|
}
|