Heera/Modules/Estimate/app/Repositories/EstimateDetailRepository.php

41 lines
872 B
PHP
Raw Normal View History

2024-05-16 09:31:08 +05:45
<?php
namespace Modules\Estimate\Repositories;
use Modules\Estimate\Models\EstimateDetail;
class EstimateDetailRepository implements EstimateDetailInterface
{
public function findAll()
{
return EstimateDetail::all();
}
public function getEstimateDetailById($EstimateDetailId)
{
return EstimateDetail::findOrFail($EstimateDetailId);
}
public function delete($EstimateDetailId)
{
EstimateDetail::destroy($EstimateDetailId);
}
public function create($EstimateDetailDetails)
{
return EstimateDetail::create($EstimateDetailDetails);
}
public function update($EstimateDetailId, array $newDetails)
{
return EstimateDetail::whereId($EstimateDetailId)->update($newDetails);
}
public function pluck()
{
return EstimateDetail::pluck('title', 'id');
}
}