StocksNew/Modules/Order/app/Repositories/PaymentModeRepository.php
Sampanna Rimal afb2c202d6 changes
2024-09-11 12:32:15 +05:45

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