changes
This commit is contained in:
15
Modules/Order/app/Repositories/PaymentModeInterface.php
Normal file
15
Modules/Order/app/Repositories/PaymentModeInterface.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Order\Repositories;
|
||||
|
||||
interface PaymentModeInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getPaymentModeById($PaymentModeId);
|
||||
public function getPaymentModeByEmail($email);
|
||||
public function delete($PaymentModeId);
|
||||
public function create($PaymentModeDetails);
|
||||
public function update($PaymentModeId, array $newDetails);
|
||||
public function pluck();
|
||||
|
||||
}
|
46
Modules/Order/app/Repositories/PaymentModeRepository.php
Normal file
46
Modules/Order/app/Repositories/PaymentModeRepository.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?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');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user