StocksNew/Modules/Office/app/Repositories/ContractRepository.php

39 lines
762 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?php
namespace Modules\Office\Repositories;
use Modules\Office\Models\Contract;
class ContractRepository implements ContractInterface
{
public function pluck(){
return Contract::pluck('name','id');
}
public function findAll()
{
return Contract::get();
}
public function getContractById($contractId)
{
return Contract::findOrFail($contractId);
}
public function delete($contractId)
{
Contract::destroy($contractId);
}
public function create(array $contractDetails)
{
return Contract::create($contractDetails);
}
public function update($contractId, array $newDetails)
{
return Contract::where('id', $contractId)->update($newDetails);
}
}