StocksNew/Modules/Admin/app/Repositories/DesignationRepository.php

40 lines
839 B
PHP
Raw Normal View History

2024-08-27 12:03:06 +00:00
<?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');
}
}