Heera/Modules/Admin/app/Repositories/DesignationRepository.php
2024-05-16 09:31:08 +05:45

40 lines
839 B
PHP

<?php
namespace Modules\Admin\Repositories;
use Modules\Admin\Models\Designation;
class DesignationRepository implements DesignationInterface
{
public function findAll()
{
return Designation::get();
}
public function getDesignationById($designationId)
{
return Designation::findOrFail($designationId);
}
public function delete($designationId)
{
Designation::destroy($designationId);
}
public function create(array $designationDetails)
{
return Designation::create($designationDetails);
}
public function update($designationId, array $newDetails)
{
return Designation::where('designation_id', $designationId)->update($newDetails);
}
public function pluck(){
return Designation::pluck('name','designation_id');
}
}