employee crud

This commit is contained in:
2024-04-10 15:15:24 +05:45
parent d92366b1f4
commit b5c603ceec
13 changed files with 420 additions and 194 deletions

View File

@ -0,0 +1,33 @@
<?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);
}
}