New-OMIS/Modules/User/app/Repositories/RoleRepository.php
2024-04-09 18:00:26 +05:45

35 lines
596 B
PHP

<?php
namespace Modules\User\Repositories;
use App\Models\Role;
class RoleRepository implements RoleInterface
{
public function findAll()
{
return Role::get();
}
public function getRoleById($roleId)
{
return Role::findOrFail($roleId);
}
public function delete($roleId)
{
Role::destroy($roleId);
}
public function create(array $roleDetails)
{
return Role::create($roleDetails);
}
public function update($roleId, array $newDetails)
{
return Role::whereId($roleId)->update($newDetails);
}
}