firstcommit
This commit is contained in:
40
Modules/Estimate/app/Repositories/EstimateRepository.php
Normal file
40
Modules/Estimate/app/Repositories/EstimateRepository.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Estimate\Repositories;
|
||||
|
||||
use Modules\Estimate\Models\Estimate;
|
||||
|
||||
class EstimateRepository implements EstimateInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Estimate::all();
|
||||
}
|
||||
|
||||
public function getEstimateById($EstimateId)
|
||||
{
|
||||
return Estimate::with('estimateDetails')->findOrFail($EstimateId);
|
||||
}
|
||||
|
||||
|
||||
public function delete($EstimateId)
|
||||
{
|
||||
Estimate::destroy($EstimateId);
|
||||
}
|
||||
|
||||
public function create($EstimateDetails)
|
||||
{
|
||||
return Estimate::create($EstimateDetails);
|
||||
}
|
||||
|
||||
public function update($EstimateId, array $newDetails)
|
||||
{
|
||||
return Estimate::whereId($EstimateId)->update($newDetails);
|
||||
}
|
||||
|
||||
public function pluck()
|
||||
{
|
||||
return Estimate::pluck('title', 'id');
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user