first commit
This commit is contained in:
38
Modules/Office/app/Repositories/ContractRepository.php
Normal file
38
Modules/Office/app/Repositories/ContractRepository.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user