StocksNew/Modules/Admin/app/Repositories/DesignationRepository.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +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');
}
}