StocksNew/Modules/Office/app/Repositories/ContractRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

39 lines
762 B
PHP

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