StocksNew/app/Service/DepartmentService.php
Sampanna Rimal 53c0140f58 first commit
2024-08-27 17:48:06 +05:45

34 lines
685 B
PHP

<?php
namespace Modules\Department\Repositories;
use Modules\Department\Models\Department;
class DepartmentService
{
public function findAll()
{
return Department::paginate(20);
}
public function getDepartmentById($DepartmentId)
{
return Department::findOrFail($DepartmentId);
}
public function delete($DepartmentId)
{
Department::destroy($DepartmentId);
}
public function create($DepartmentDetails)
{
return Department::create($DepartmentDetails);
}
public function update($DepartmentId, array $newDetails)
{
return Department::whereId($DepartmentId)->update($newDetails);
}
}