New-OMIS/Modules/Admin/app/Repositories/TransferRepository.php

36 lines
689 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Transfer;
class TransferRepository implements TransferInterface
{
public function findAll()
{
return Transfer::get();
}
public function getTransferById($transferId)
{
return Transfer::findOrFail($transferId);
}
public function delete($transferId)
{
Transfer::destroy($transferId);
}
public function create(array $transferDetails)
{
return Transfer::create($transferDetails);
}
public function update($transferId, array $newDetails)
{
return Transfer::where('transfer_id', $transferId)->update($newDetails);
}
}