36 lines
665 B
PHP
36 lines
665 B
PHP
<?php
|
|
|
|
namespace Modules\Office\Repositories;
|
|
|
|
use Modules\Office\Models\Deposit;
|
|
|
|
|
|
class DepositRepository implements DepositInterface
|
|
{
|
|
public function findAll()
|
|
{
|
|
return Deposit::get();
|
|
}
|
|
|
|
public function getDepositById($depositId)
|
|
{
|
|
return Deposit::findOrFail($depositId);
|
|
}
|
|
|
|
public function delete($depositId)
|
|
{
|
|
Deposit::destroy($depositId);
|
|
}
|
|
|
|
public function create(array $depositDetails)
|
|
{
|
|
return Deposit::create($depositDetails);
|
|
}
|
|
|
|
public function update($depositId, array $newDetails)
|
|
{
|
|
return Deposit::where('id', $depositId)->update($newDetails);
|
|
}
|
|
|
|
}
|